]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
ldconfig: avoid leak on empty paths in config file
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Tue, 3 Aug 2021 15:40:10 +0000 (21:10 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Tue, 3 Aug 2021 15:40:10 +0000 (21:10 +0530)
Reviewed-by: Arjun Shankar <arjun@redhat.com>
elf/ldconfig.c

index 1037e8d0cf8d28b6ab681360169ed43eba88f362..b8893637f8aaea8d353cc78d18355387f2aeaa91 100644 (file)
@@ -503,7 +503,11 @@ add_dir_1 (const char *line, const char *from_file, int from_line)
     entry->path[--i] = '\0';
 
   if (i == 0)
-    return;
+    {
+      free (entry->path);
+      free (entry);
+      return;
+    }
 
   char *path = entry->path;
   if (opt_chroot != NULL)