From 515754faacf9dd33b94e6e5a17ca04d27d61f482 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 21 Aug 2007 23:29:10 -0400 Subject: Various valgrind mem leak fixes Signed-off-by: Dan McGee --- src/pacman/pacman.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index a5eff64e..31302abe 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -507,8 +507,7 @@ static int _parseconfig(const char *file, const char *givensection, } } else { /* directive */ - char *key; - const char *upperkey; + char *key, *upperkey; /* strsep modifies the 'line' string: 'key \0 ptr' */ key = line; ptr = line; @@ -677,9 +676,13 @@ static int _parseconfig(const char *file, const char *givensection, return(1); } } + free(upperkey); } } fclose(fp); + if(section){ + free(section); + } pm_printf(PM_LOG_DEBUG, "config: finished parsing %s\n", file); return(0); -- cgit v1.2.3-70-g09d2