Commit be498a24 authored by Simon Jakobi's avatar Simon Jakobi Committed by Ben Gamari

RTS: Remember to free some pointers

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari, simonmar

Subscribers: Phyx, rwbarton, thomie, carter

GHC Trac Issues: #11777

Differential Revision: https://phabricator.haskell.org/D4428
parent c969c987
......@@ -437,7 +437,10 @@ AddIORequest ( int fd,
{
WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
unsigned int reqID;
if (!ioMan || !wItem) return 0;
if (!ioMan || !wItem) {
free(wItem);
return 0;
}
reqID = ioMan->requestID++;
/* Fill in the blanks */
......@@ -466,7 +469,10 @@ AddDelayRequest ( HsInt usecs,
{
WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
unsigned int reqID;
if (!ioMan || !wItem) return false;
if (!ioMan || !wItem) {
free(wItem);
return false;
}
reqID = ioMan->requestID++;
/* Fill in the blanks */
......@@ -491,7 +497,10 @@ AddProcRequest ( void* proc,
{
WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
unsigned int reqID;
if (!ioMan || !wItem) return false;
if (!ioMan || !wItem) {
free(wItem);
return false;
}
reqID = ioMan->requestID++;
/* Fill in the blanks */
......
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