mirror of
https://github.com/tmux/tmux.git
synced 2024-11-16 01:18:52 +00:00
Don't leak FILE * on malloc failure. From ivoire at users dot sourceforge dot net.
This commit is contained in:
parent
86c93c6e34
commit
29f9d5f335
@ -78,6 +78,7 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
*/
|
*/
|
||||||
if ((buf = malloc(statbuf.st_size + 1)) == NULL) {
|
if ((buf = malloc(statbuf.st_size + 1)) == NULL) {
|
||||||
ctx->error(ctx, "malloc error: %s", strerror(errno));
|
ctx->error(ctx, "malloc error: %s", strerror(errno));
|
||||||
|
fclose(f);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user