From: Pauli Date: Mon, 10 May 2021 00:17:38 +0000 (+1000) Subject: coverity: fix 1484539 resource leak X-Git-Tag: openssl-3.0.0-alpha17~179 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b0f6402bf41a66ebfa13e98bb96763d01bb27d2f;p=thirdparty%2Fopenssl.git coverity: fix 1484539 resource leak Reviewed-by: Shane Lontis Reviewed-by: Ben Kaduk (Merged from https://github.com/openssl/openssl/pull/15208) --- diff --git a/apps/kdf.c b/apps/kdf.c index 7b016051f1f..c4892ed20ec 100644 --- a/apps/kdf.c +++ b/apps/kdf.c @@ -52,13 +52,14 @@ static char *alloc_kdf_algorithm_name(STACK_OF(OPENSSL_STRING) **optp, const char *name, const char *arg) { size_t len = strlen(name) + strlen(arg) + 2; - char *res = app_malloc(len, "algorithm name"); + char *res; if (*optp == NULL) *optp = sk_OPENSSL_STRING_new_null(); if (*optp == NULL) return NULL; + res = app_malloc(len, "algorithm name"); BIO_snprintf(res, len, "%s:%s", name, arg); if (sk_OPENSSL_STRING_push(*optp, res)) return res;