Make sure ret->name is NULL'ed before return when freeing.
authorbeck <beck@openbsd.org>
Wed, 23 Apr 2014 04:33:10 +0000 (04:33 +0000)
committerbeck <beck@openbsd.org>
Wed, 23 Apr 2014 04:33:10 +0000 (04:33 +0000)
from Dirk Engling <erdgeist@erdgeist.org>

lib/libcrypto/asn1/x_x509.c
lib/libssl/src/crypto/asn1/x_x509.c

index e7d613e..e93d97d 100644 (file)
@@ -125,6 +125,7 @@ x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
 #endif
                if (ret->name != NULL)
                        free(ret->name);
+               ret->name = NULL;
                break;
        }
 
index e7d613e..e93d97d 100644 (file)
@@ -125,6 +125,7 @@ x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
 #endif
                if (ret->name != NULL)
                        free(ret->name);
+               ret->name = NULL;
                break;
        }