summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--poptconfig.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/poptconfig.c b/poptconfig.c
index f44be33..0a9a50d 100644
--- a/poptconfig.c
+++ b/poptconfig.c
@@ -396,8 +396,10 @@ int poptReadConfigFile(poptContext con, const char * fn)
if ((rc = poptReadFile(fn, &b, &nb, POPT_READFILE_TRIMNEWLINES)) != 0)
return (errno == ENOENT ? 0 : rc);
- if (b == NULL || nb == 0)
- return POPT_ERROR_BADCONFIG;
+ if (b == NULL || nb == 0) {
+ rc = POPT_ERROR_BADCONFIG;
+ goto exit;
+ }
if ((t = (char*) malloc(nb + 1)) == NULL)
goto exit;