]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
setup: fix memory leak
authorAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 9 Jan 2016 10:10:10 +0000 (13:10 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 9 Jan 2016 10:10:10 +0000 (13:10 +0300)
Found by: Coverity scan.
CID: 73680, 73715

util/setup.c

index 8f20e9983d21ffb1047c7037281d5d66d10efb60..d74567d0a7e8d25b7e44a96fdf348a35073e2f52 100644 (file)
@@ -353,6 +353,10 @@ SETUP (const char *dir,
       }
     grub_util_info ("guessed root_dev `%s' from "
                    "dir `%s'", root_dev->disk->name, dir);
+
+    for (cur = root_devices; *cur; cur++)
+      free (*cur);
+    free (root_devices);
   }
 
   grub_util_info ("setting the root device to `%s'", root);