diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/x509/v3_lib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/x509/v3_lib.c b/crypto/x509/v3_lib.c index 42b6ff1527..5c05b56d9c 100644 --- a/crypto/x509/v3_lib.c +++ b/crypto/x509/v3_lib.c @@ -242,8 +242,10 @@ int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, } /* If delete, just delete it */ if (ext_op == X509V3_ADD_DELETE) { - if (!sk_X509_EXTENSION_delete(*x, extidx)) + extmp = sk_X509_EXTENSION_delete(*x, extidx); + if (extmp == NULL) return -1; + X509_EXTENSION_free(extmp); return 1; } } else { |