From: Florian Weimer Date: Wed, 6 Sep 2017 13:47:27 +0000 (+0200) Subject: resolv: __resolv_conf_attach must not free passed conf object [BZ #22096] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27233446a62ca35ce0b54566279a99a6774d4210;p=thirdparty%2Fglibc.git resolv: __resolv_conf_attach must not free passed conf object [BZ #22096] (cherry picked from commit a83047308196e3e54716a39dd85c0a08b198d6bd) --- diff --git a/ChangeLog b/ChangeLog index ef2041b9e57..e98a4bbf3c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-09-06 Florian Weimer + + [BZ #22096] + * resolv/resolv_conf.c (__resolv_conf_attach): Do not free conf in + case of failure to obtain the global conf object. + 2017-09-06 Florian Weimer [BZ #22095] diff --git a/NEWS b/NEWS index 62959274b3b..9bcb1761717 100644 --- a/NEWS +++ b/NEWS @@ -29,6 +29,7 @@ The following bugs are resolved with this release: [21941] powerpc: Restrict xssqrtqp operands to Vector Registers [21972] assert macro requires operator== (int) for its argument type [22095] resolv: Fix memory leak with OOM during resolv.conf parsing + [22096] resolv: __resolv_conf_attach must not free passed conf object Version 2.26 diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c index f391d30c277..e0f296d02e0 100644 --- a/resolv/resolv_conf.c +++ b/resolv/resolv_conf.c @@ -600,10 +600,7 @@ __resolv_conf_attach (struct __res_state *resp, struct resolv_conf *conf) struct resolv_conf_global *global_copy = get_locked_global (); if (global_copy == NULL) - { - free (conf); - return false; - } + return false; /* Try to find an unused index in the array. */ size_t index;