From f758773cd05bb3777adb42a78969643b294de2c4 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 16 Mar 2011 13:29:47 +1100 Subject: [PATCH] Fix one minor leak. --- main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index bf89455..f3d0e37 100644 --- a/main.c +++ b/main.c @@ -315,7 +315,7 @@ static void read_config( struct rzip_control *control ) } } if (fp == NULL) - return; + goto out; /* if we get here, we have a file. read until no more. */ @@ -422,13 +422,13 @@ static void read_config( struct rzip_control *control ) parameter, parametervalue); } + if (unlikely(fclose(fp))) + fatal("Failed to fclose fp in read_config\n"); +out: /* clean up */ free(line); free(homeconf); - if (unlikely(fclose(fp))) - fatal("Failed to fclose fp in read_config\n"); - /* fprintf(stderr, "\nWindow = %d \ \nCompression Level = %d \ \nThreshold = %1.2f \