diff options
author | Dan McGee <dan@archlinux.org> | 2007-08-21 23:29:10 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-08-21 23:29:10 -0400 |
commit | 515754faacf9dd33b94e6e5a17ca04d27d61f482 (patch) | |
tree | 4788e1d46318b1fd21184696683ec779a9ec7ddb /src/pacman/pacman.c | |
parent | d09d114e99c29d1392c546a6553650ecde5138fc (diff) |
Various valgrind mem leak fixes
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/pacman.c')
-rw-r--r-- | src/pacman/pacman.c | 7 |
1 files changed, 5 insertions, 2 deletions
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); |