From 4294ccc608eaecffe3f78d5271e9de1159ce03b2 Mon Sep 17 00:00:00 2001 From: Agathiyan Bragadeesh Date: Tue, 15 Aug 2023 16:32:00 +0100 Subject: [PATCH] Use mbedtls_calloc instead of calloc Signed-off-by: Agathiyan Bragadeesh --- library/x509_create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/x509_create.c b/library/x509_create.c index 0f1b8d0e59..46ffc9c8de 100644 --- a/library/x509_create.c +++ b/library/x509_create.c @@ -145,7 +145,7 @@ static char *x509_oid_from_numericoid(const char *numericoid, mbedtls_free(oid_buf); return NULL; } - oid = calloc(1, oid_buf->len + 1); + oid = mbedtls_calloc(1, oid_buf->len + 1); memcpy(oid, oid_buf->p, oid_buf->len); oid[oid_buf->len + 1] = '\0'; mbedtls_free(oid_buf->p); @@ -285,7 +285,7 @@ int mbedtls_x509_string_to_names(mbedtls_asn1_named_data **head, const char *nam numericoid = 1; } } else { - oid = calloc(1, strlen(attr_descr->oid)); + oid = mbedtls_calloc(1, strlen(attr_descr->oid)); strcpy(oid, attr_descr->oid); numericoid = 0; }