Fix C code generate by 'openssl dsaparam -C'.
authorBodo Möller <bodo@openssl.org>
Wed, 10 Jan 2001 14:26:32 +0000 (14:26 +0000)
committerBodo Möller <bodo@openssl.org>
Wed, 10 Jan 2001 14:26:32 +0000 (14:26 +0000)
CHANGES
apps/dsaparam.c

diff --git a/CHANGES b/CHANGES
index 77ad4d16f7bee111b792152b5dc7a9ba22f9fe3c..abddaa43fd8d5729d31b8bea082626560e7017d4 100644 (file)
--- 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
index 517791620249a5bdd3e8eed37e8c8d0509a372bc..d3501c2606068861471f7ac750377f37681cb267 100644 (file)
@@ -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");
                }