pacman-conf: free rootdir before replacing
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
4311cc3648
commit
5d21b2d44c
1 changed files with 1 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue