Fixes #26203
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26227)
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;
if (data == NULL)
return -1;
- return sk_OPENSSL_STRING_push(controls, data) > 0;
+
+ if (sk_OPENSSL_STRING_push(controls, data) <= 0) {
+ OPENSSL_free(data);
+ return -1;
+ }
+
+ return 1;
}
/* Because OPENSSL_free is a macro, it can't be passed as a function pointer */