Commit 95da4097 authored by Austin Seipp's avatar Austin Seipp
Browse files

rts: Fix potential memory leak in ProfHeap.c



Discovered by Coverity. CID 43166.
Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 07388af8
......@@ -331,16 +331,17 @@ void initProfiling2 (void)
/* Initialise the log file name */
hp_filename = stgMallocBytes(strlen(prog) + 6, "hpFileName");
sprintf(hp_filename, "%s.hp", prog);
/* open the log file */
if ((hp_file = fopen(hp_filename, "w")) == NULL) {
debugBelch("Can't open profiling report file %s\n",
debugBelch("Can't open profiling report file %s\n",
hp_filename);
RtsFlags.ProfFlags.doHeapProfile = 0;
stgFree(prog);
return;
}
}
stgFree(prog);
initHeapProfiling();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment