Skip to content

Commit 88dfced

Browse files
committed
resource: fix leak in update_properties()
Problem: If there are no properties in the 'all' resource set then alloc_ranks idset is leaked. Free alloc_ranks before returning if there's no properties.
1 parent 971b4e5 commit 88dfced

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/modules/resource/status.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ static int update_properties (struct rlist *alloc, struct rlist *all)
218218
if (!(props = get_properties (all))
219219
|| json_object_size (props) == 0) {
220220
json_decref (props);
221+
idset_destroy (alloc_ranks);
221222
return 0;
222223
}
223224
json_object_foreach (props, name, val) {

0 commit comments

Comments
 (0)