From b3107d26dfdabaeaffa558db40e69962e7c697f6 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 9 Aug 2009 08:34:17 +0000 Subject: [PATCH] Don't leak in the (rare) case of an invalid command at the end of a file not terminated by a \n. --- cfg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cfg.c b/cfg.c index 6320641e..75390165 100644 --- a/cfg.c +++ b/cfg.c @@ -112,6 +112,8 @@ load_cfg(const char *path, char **cause) return (0); error: + if (line != NULL) + xfree(line); fclose(f); xasprintf(&ptr, "%s: %s at line %u", path, *cause, n);