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

diff --git a/CHANGES b/CHANGES
index 3a256cbb0c425f205614e41e1d41b4c04b330da3..5e4fa3e706b41b95e8f8191d47fad6c923efe154 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,10 @@
 
  Changes between 0.9.6 and 0.9.6a  [xx XXX 2000]
 
+  *) Fix C code generated by 'openssl dsaparam -C': If a BN_bin2bn
+     call failed, free the DSA structure.
+     [Bodo Moeller]
+
   *) Fix to uni2asc() to cope with zero length Unicode strings.
      These are present in some PKCS#12 files.
      [Steve Henson]
index f861ec7b1ad8cf2d1c6e31b70b5c85d30f2974a2..4e8dcd3a68fd5fe2d7e0b7a3a886fed87ac902f1 100644 (file)
@@ -311,7 +311,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");
                }