diff options
author | Pauli <pauli@openssl.org> | 2021-05-10 02:17:38 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-05-12 03:11:53 +0200 |
commit | b0f6402bf41a66ebfa13e98bb96763d01bb27d2f (patch) | |
tree | 4776cf59bc81d456e9f52bab920a255d8724ce07 /apps/kdf.c | |
parent | 80-test_cmp_http.t: Improve fuzzing exclusion pattern - fixup! (diff) | |
download | openssl-b0f6402bf41a66ebfa13e98bb96763d01bb27d2f.tar.xz openssl-b0f6402bf41a66ebfa13e98bb96763d01bb27d2f.zip |
coverity: fix 1484539 resource leak
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/15208)
Diffstat (limited to 'apps/kdf.c')
-rw-r--r-- | apps/kdf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/kdf.c b/apps/kdf.c index 7b016051f1..c4892ed20e 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; |