Skip to content

Commit

Permalink
job-list: fix potential double free of a hostlist struct
Browse files Browse the repository at this point in the history
Problem: In the job-list hostlist match function, if an append to the
list of hostlist structs fails, then a double free of the hostlist
could occur since `goto error` already destroys the hostlist.

Remove the extra hostlist_destroy() in the error path.
  • Loading branch information
grondo committed Jun 19, 2024
1 parent 648306d commit 3599702
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/modules/job-list/match.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ static struct list_constraint *create_hostlist_constraint (
}
if (!zlistx_add_end (c->values, hl)) {
errprintf (errp, "failed to append hostlist structure");
hostlist_destroy (hl);
goto error;
}
return c;
Expand Down

0 comments on commit 3599702

Please sign in to comment.