Don't leak in the (rare) case of an invalid command at the end of a file not

terminated by a \n.
This commit is contained in:
Nicholas Marriott 2009-08-09 08:34:17 +00:00
parent 05f1680efa
commit b3107d26df

2
cfg.c
View File

@ -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);