diff options
Diffstat (limited to 'crypto/x509/by_store.c')
-rw-r--r-- | crypto/x509/by_store.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/x509/by_store.c b/crypto/x509/by_store.c index 9ba5b31a44..1474474a2d 100644 --- a/crypto/x509/by_store.c +++ b/crypto/x509/by_store.c @@ -122,7 +122,11 @@ static int by_store_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argp, uris = sk_OPENSSL_STRING_new_null(); X509_LOOKUP_set_method_data(ctx, uris); } - return sk_OPENSSL_STRING_push(uris, data) > 0; + if (sk_OPENSSL_STRING_push(uris, data) <= 0) { + OPENSSL_free(data); + return 0; + } + return 1; } /* NOP if no URI is given. */ return 1; |