summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-07-05 23:30:54 +0200
committerDan McGee <dan@archlinux.org>2011-07-05 21:36:46 -0500
commit36474af463d0d8ce758f827d31a378624062b955 (patch)
tree85cb2becdcd36454d9a3270248a6cfe1cd2cdc8e /src
parentae7139adcfa65991c71616e8de7910ff722d4166 (diff)
downloadpacman-36474af463d0d8ce758f827d31a378624062b955.tar.xz
fix segfault if pacman.conf can't be read
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/conf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 3af3fa5b..fac6da34 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -750,7 +750,9 @@ static int _parseconfig(const char *file, struct section_t *section,
}
cleanup:
- fclose(fp);
+ if (fp) {
+ fclose(fp);
+ }
pm_printf(ALPM_LOG_DEBUG, "config: finished parsing %s\n", file);
return ret;
}