mirror of
https://github.com/tmate-io/tmate.git
synced 2025-07-15 05:24:59 +02:00
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:
2
cfg.c
2
cfg.c
@ -112,6 +112,8 @@ load_cfg(const char *path, char **cause)
|
|||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
if (line != NULL)
|
||||||
|
xfree(line);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
xasprintf(&ptr, "%s: %s at line %u", path, *cause, n);
|
xasprintf(&ptr, "%s: %s at line %u", path, *cause, n);
|
||||||
|
Reference in New Issue
Block a user