[pacman-dev] [PATCH] check config_new return value
24 Mar
2014
24 Mar
'14
2:59 p.m.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> --- 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 9791ced..ef86d39 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))) { -- 1.9.0
3875
Age (days ago)
3875
Last active (days ago)
0 comments
1 participants
participants (1)
-
Andrew Gregory