From 5d21b2d44c1727e33bd7c71e657501eb013c44d0 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Fri, 15 Jan 2021 23:20:56 -0800 Subject: pacman-conf: free rootdir before replacing Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- src/pacman/pacman-conf.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/pacman/pacman-conf.c b/src/pacman/pacman-conf.c index 463badf1..05492ed9 100644 --- a/src/pacman/pacman-conf.c +++ b/src/pacman/pacman-conf.c @@ -76,6 +76,7 @@ static void parse_opts(int argc, char **argv) config_file = optarg; break; case 'R': + free(config->rootdir); if ((config->rootdir = strdup(optarg)) == NULL) { fprintf(stderr, _("error setting rootdir '%s': out of memory\n"), optarg); cleanup(); -- cgit v1.2.3-70-g09d2