Skip to content

Commit 2e23a37

Browse files
garlickchu11
authored andcommitted
job-list: fix memory leak on error path
Problem: if depthfirst_map_one() fails to look up R, futures are leaked. Ensure that particular failure unwinds allocations like the others.
1 parent ebd4459 commit 2e23a37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modules/job-list/job_state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ static int depthfirst_map_one (struct job_state_ctx *jsctx,
714714
if (job->states_mask & FLUX_JOB_STATE_RUN) {
715715
if (flux_job_kvs_key (path, sizeof (path), id, "R") < 0) {
716716
errno = EINVAL;
717-
return -1;
717+
goto done;
718718
}
719719
if (!(f3 = flux_kvs_lookup (jsctx->h, NULL, 0, path)))
720720
goto done;

0 commit comments

Comments
 (0)