From 964640fbfcde48b7937a6c18964c78a3b11db3de Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sat, 24 Nov 2012 13:15:04 -0500 Subject: Plug various minor memory leaks Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- src/pacman/pacman.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 1ca746d7..a25bbf84 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -812,10 +812,11 @@ int main(int argc, char *argv[]) /* we support reading targets from stdin if a cmdline parameter is '-' */ if(!isatty(fileno(stdin)) && alpm_list_find_str(pm_targets, "-")) { size_t current_size = PATH_MAX; - char *line = malloc(current_size); + char *vdata, *line = malloc(current_size); /* remove the '-' from the list */ - pm_targets = alpm_list_remove_str(pm_targets, "-", NULL); + pm_targets = alpm_list_remove_str(pm_targets, "-", &vdata); + free(vdata); i = 0; while((line[i] = (char)fgetc(stdin)) != EOF) { -- cgit v1.2.3