Skip to content

Commit b6ae383

Browse files
committed
libsdexec: fix memory leak
Problem: running t2409-sdexec.t under valgrind turned up this leak: ==3090348== 168 (32 direct, 136 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 7 ==3090348== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==3090348== by 0x83E9592: idset_create (idset.c:42) ==3090348== by 0x83E9F6C: idset_ndecode (idset_decode.c:121) ==3090348== by 0x83D4A19: sdexec_parse_bitmap (parse.c:58) ==3090348== by 0x83D2C18: prop_add (start.c:249) ==3090348== by 0x83D2C18: prop_create (start.c:313) ==3090348== by 0x83D32A0: sdexec_start_transient_unit (start.c:345) ==3090348== by 0x83D21A3: exec_cb (sdexec.c:607) ==3090348== by 0x4880407: call_handler (msg_handler.c:345) ==3090348== by 0x4880799: dispatch_message (msg_handler.c:381) ==3090348== by 0x4880799: handle_cb (msg_handler.c:482) ==3090348== by 0x48B4DA2: ev_invoke_pending (ev.c:3770) ==3090348== by 0x48B884F: ev_run (ev.c:4190) ==3090348== by 0x48B884F: ev_run (ev.c:4021) ==3090348== by 0x487F48E: flux_reactor_run (reactor.c:128) Fix leak in sdexec_parse_bitmap().
1 parent dbedc81 commit b6ae383

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/libsdexec/parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ int sdexec_parse_bitmap (const char *s, uint8_t **bp, size_t *sp)
7171
BITMAP_BYTE (bitmap, id) |= BITMAP_BIT (id);
7272
id = idset_next (ids, id);
7373
}
74-
idset_destroy (ids);
7574
}
7675
*bp = bitmap;
7776
*sp = BITMAP_NBYTES (nbits);
77+
idset_destroy (ids);
7878
return 0;
7979
}
8080

0 commit comments

Comments
 (0)