From c06648f7f00002c84e92cec6b819f7053401ad9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Wed, 10 Jan 2001 14:26:32 +0000 Subject: [PATCH] Fix C code generate by 'openssl dsaparam -C'. --- CHANGES | 4 ++++ apps/dsaparam.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 77ad4d16f7..abddaa43fd 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,10 @@ Changes between 0.9.6 and 0.9.7 [xx XXX 2000] + *) Fix C code generated by 'openssl dsaparam -C': If a BN_bin2bn + call failed, free the DSA structure. + [Bodo Moeller] + *) Add another call level for memory allocation routines, thereby allowing memory allocation callbacks that can be given file name and line number information. The basic functionality diff --git a/apps/dsaparam.c b/apps/dsaparam.c index 5177916202..d3501c2606 100644 --- a/apps/dsaparam.c +++ b/apps/dsaparam.c @@ -338,7 +338,7 @@ bad: printf("\tdsa->g=BN_bin2bn(dsa%d_g,sizeof(dsa%d_g),NULL);\n", bits_p,bits_p); printf("\tif ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))\n"); - printf("\t\treturn(NULL);\n"); + printf("\t\t{ DSA_free(dsa); return(NULL); }\n"); printf("\treturn(dsa);\n\t}\n"); } -- 2.25.1