[COMMITTED] resolv: __resolv_conf_attach must not free passed conf object [BZ #22096]

Message ID 20170906133722.9AC8140240833@oldenburg.str.redhat.com
State New
Headers show
Series
  • [COMMITTED] resolv: __resolv_conf_attach must not free passed conf object [BZ #22096]
Related show

Commit Message

Florian Weimer Sept. 6, 2017, 1:37 p.m.
2017-09-06  Florian Weimer  <fweimer@redhat.com>

	[BZ #22096]
	* resolv/resolv_conf.c (__resolv_conf_attach): Do not free conf in
	case of failure to obtain the global conf object.

Patch

diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c
index f391d30c27..e0f296d02e 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;