Don't leak FILE * on malloc failure. From ivoire at users dot sourceforge dot net.

This commit is contained in:
Nicholas Marriott 2009-07-09 09:54:56 +00:00
parent 86c93c6e34
commit 29f9d5f335

View File

@ -78,6 +78,7 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
*/
if ((buf = malloc(statbuf.st_size + 1)) == NULL) {
ctx->error(ctx, "malloc error: %s", strerror(errno));
fclose(f);
return (-1);
}