summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2019-04-14 13:59:54 -0500
committerShawn Landden <shawn@git.icu>2019-04-14 13:59:54 -0500
commitbbfddaa66e85913abce5f978c6b22a11d37326bc (patch)
tree118609441c0099e0d4476552f46073e67c73e296 /src
parentb49b00ebf5e6c8eef786c632c58beb53594a1164 (diff)
downloaddistcc-git-bbfddaa66e85913abce5f978c6b22a11d37326bc.tar.gz
simplify recent bug fix
Diffstat (limited to 'src')
-rw-r--r--src/stringmap.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/stringmap.c b/src/stringmap.c
index 483e86a..7a2fa62 100644
--- a/src/stringmap.c
+++ b/src/stringmap.c
@@ -48,15 +48,13 @@ stringmap_t *stringmap_load(const char *filename, int numFinalWordsToMatch)
char buf[2*PATH_MAX];
int n;
+ fp = fopen(filename, "r");
+ if (!fp)
+ return NULL;
result = calloc(1, sizeof(*result));
if (!result)
return NULL;
result->numFinalWordsToMatch = numFinalWordsToMatch;
- fp = fopen(filename, "r");
- if (!fp) {
- free(result);
- return NULL;
- }
n=0;
while (fgets(buf, sizeof(buf), fp))
n++;