summary refs log tree commit diff
path: root/resolv
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-09-06 15:20:25 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-09-06 15:20:25 +0200
commit5670c4ab256114e869b1df4b05653aa5f909182c (patch)
tree59b44addcc1c16776c22cd44e1d41819e33673ff /resolv
parentc77eb96925b719001237ca7c9e3cef40d795d66b (diff)
downloadglibc-5670c4ab256114e869b1df4b05653aa5f909182c.tar.gz
glibc-5670c4ab256114e869b1df4b05653aa5f909182c.tar.xz
glibc-5670c4ab256114e869b1df4b05653aa5f909182c.zip
resolv: Fix memory leak with OOM during resolv.conf parsing [BZ #22095]
Diffstat (limited to 'resolv')
-rw-r--r--resolv/res_init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/resolv/res_init.c b/resolv/res_init.c
index fa46ce7813..4e1f9fe8de 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -446,6 +446,11 @@ res_vinit_1 (FILE *fp, struct resolv_conf_parser *parser)
                     (&parser->nameserver_list);
                   if (p != NULL)
                     *p = sa;
+                  else
+                    {
+                      free (sa);
+                      return false;
+                    }
                 }
               continue;
             }