Fix coverity issue
1681707
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Feb 26 15:05:37 2026
(Merged from https://github.com/openssl/openssl/pull/30169)
X509_BUFFER *buf;
if ((buf = OPENSSL_zalloc(sizeof *buf)) != NULL
- && (buf->data = OPENSSL_memdup(bytes, length)) != NULL)
+ && (buf->data = OPENSSL_memdup(bytes, length)) != NULL) {
buf->len = length;
- else
+ } else {
OPENSSL_free(buf);
+ buf = NULL;
+ }
return buf;
}