MAKE: plug memory leak

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

MAKE: plug memory leak

Marc Espie-2
If we look at job_handle_status, we see there's one case where it
doesn't place the job on the errorJob list, but doesn't try to reclaim
the memory.

Index: job.c
===================================================================
RCS file: /cvs/src/usr.bin/make/job.c,v
retrieving revision 1.143
diff -u -p -r1.143 job.c
--- job.c 30 Dec 2019 11:01:16 -0000 1.143
+++ job.c 31 Dec 2019 11:46:57 -0000
@@ -543,7 +544,8 @@ postprocess_job(Job *job)
  job->node->built_status = REBUILT;
  Make_Update(job->node);
  free(job);
- }
+ } else if (job->exit_type != JOB_EXIT_OKAY && keepgoing)
+ free(job);
 
  if (errorJobs != NULL && !keepgoing &&
     aborting != ABORT_INTERRUPT)