diff options
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2014-01-13 23:01:42 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2014-01-28 20:10:49 +1000 |
commit | e6464f0cb6c36bf047a1dbdbf5cd313ff4fd2dbf (patch) | |
tree | c731a243d36ac8af818efe6993c6598a8faafb20 | |
parent | 4e9d88aa05184e29368f1602b9fcb6a05d293095 (diff) | |
download | pacman-e6464f0cb6c36bf047a1dbdbf5cd313ff4fd2dbf.tar.xz |
pacman.c: free string commandline options
Plugs a memory leak when values were passed twice.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r-- | src/pacman/pacman.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 1fb447c6..748bc546 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -443,9 +443,11 @@ static int parsearg_global(int opt) config->noprogressbar = 1; break; case OP_GPGDIR: + free(config->gpgdir); config->gpgdir = strdup(optarg); break; case OP_LOGFILE: + free(config->logfile); config->logfile = strndup(optarg, PATH_MAX); break; case OP_NOCONFIRM: @@ -453,10 +455,12 @@ static int parsearg_global(int opt) break; case OP_DBPATH: case 'b': + free(config->dbpath); config->dbpath = strdup(optarg); break; case OP_ROOT: case 'r': + free(config->rootdir); config->rootdir = strdup(optarg); break; case OP_VERBOSE: @@ -623,6 +627,7 @@ static int parsearg_trans(int opt) break; case OP_PRINTFORMAT: config->print = 1; + free(config->print_format); config->print_format = strdup(optarg); break; default: |