asn1: Use calloc() in generated C code

This commit is contained in:
Nicolas Williams
2022-01-12 17:01:37 -06:00
parent 1fe3d293e1
commit f0c46e7830
3 changed files with 7 additions and 7 deletions

View File

@@ -258,7 +258,7 @@ init_generate (const char *filename, const char *base)
fputs("#define ASN1_MALLOC_ENCODE(T, B, BL, S, L, R) \\\n"
" do { \\\n"
" (BL) = length_##T((S)); \\\n"
" (B) = malloc((BL)); \\\n"
" (B) = calloc(1, (BL)); \\\n"
" if((B) == NULL) { \\\n"
" *(L) = 0; \\\n"
" (R) = ENOMEM; \\\n"