From: Pauli Date: Mon, 10 May 2021 00:18:07 +0000 (+1000) Subject: coverity: fix 1484540 resource leak X-Git-Tag: openssl-3.0.0-alpha17~178 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=54e1c14a29ef338a60ef180e213ffaeb3010f798;p=thirdparty%2Fopenssl.git coverity: fix 1484540 resource leak Reviewed-by: Shane Lontis Reviewed-by: Ben Kaduk (Merged from https://github.com/openssl/openssl/pull/15208) --- diff --git a/apps/mac.c b/apps/mac.c index ca02a781e57..5f80ca22c78 100644 --- a/apps/mac.c +++ b/apps/mac.c @@ -56,13 +56,14 @@ static char *alloc_mac_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;