From: Xiangyu Bu Date: Wed, 18 Oct 2017 00:10:53 +0000 (-0700) Subject: Fix memory leak in GENERAL_NAME_set0_othername. X-Git-Tag: OpenSSL_1_1_0g~26 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4ed22d63a7b150b2066f4fa676950786519c602b;p=oweals%2Fopenssl.git Fix memory leak in GENERAL_NAME_set0_othername. CLA: trivial Reviewed-by: Tim Hudson Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/4544) (cherry picked from commit 04761b557a53f026630dd5916b2b8522d94579db) --- diff --git a/crypto/x509v3/v3_genn.c b/crypto/x509v3/v3_genn.c index 8d1199748c..85fc3fc246 100644 --- a/crypto/x509v3/v3_genn.c +++ b/crypto/x509v3/v3_genn.c @@ -181,6 +181,7 @@ int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, oth = OTHERNAME_new(); if (oth == NULL) return 0; + ASN1_TYPE_free(oth->value); oth->type_id = oid; oth->value = value; GENERAL_NAME_set0_value(gen, GEN_OTHERNAME, oth);