From 36474af463d0d8ce758f827d31a378624062b955 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 5 Jul 2011 23:30:54 +0200 Subject: [PATCH] fix segfault if pacman.conf can't be read Signed-off-by: Florian Pritz Signed-off-by: Dan McGee --- src/pacman/conf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }