From 57e7f1b775f6c152eff1dd88a8c1399799828112 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 9 Jan 2016 13:10:10 +0300 Subject: [PATCH] setup: fix memory leak Found by: Coverity scan. CID: 73680, 73715 --- util/setup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/setup.c b/util/setup.c index 8f20e9983..d74567d0a 100644 --- a/util/setup.c +++ b/util/setup.c @@ -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);