resolv: __resolv_conf_attach must not free passed conf object [BZ #22096]
authorFlorian Weimer <fweimer@redhat.com>
Wed, 6 Sep 2017 13:32:43 +0000 (15:32 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 6 Sep 2017 13:32:43 +0000 (15:32 +0200)
ChangeLog
resolv/resolv_conf.c

index 298f0fdcbdbc88ca4af7dee534228ffefbd5cb42..6150ba16d6ca9a1cafeaeef7c16ec9bb040f6b24 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
 2017-09-06  Florian Weimer  <fweimer@redhat.com>
 
        [BZ #22095]
index f391d30c277bb3481ffef7ac74f9a198981ddecf..e0f296d02e061a89d02017f9fa671f8833d58093 100644 (file)
@@ -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;