diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c index df132d84c2..68e17e5d63 100644 --- a/src/tool_cb_wrt.c +++ b/src/tool_cb_wrt.c @@ -99,6 +99,7 @@ bool tool_create_output_file(struct OutStruct *outs, newname = malloc(newlen); if(!newname) { errorf(global, "out of memory\n"); + free(aname); return FALSE; } memcpy(newname, fname, len);