From b0dc547fcbc3e4b0116f8982d500635ebdeb506c Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Mon, 24 Mar 2014 09:59:42 -0400 Subject: check config_new return value Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- src/pacman/pacman.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 9791ced6..ef86d39a 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -1045,7 +1045,10 @@ int main(int argc, char *argv[]) setuseragent(); /* init config data */ - config = config_new(); + if(!(config = config_new())) { + /* config_new prints the appropriate error message */ + cleanup(1); + } /* disable progressbar if the output is redirected */ if(!isatty(fileno(stdout))) { -- cgit v1.2.3