Skip to content

Commit 1927971

Browse files
committed
sdexec: fix memory leak
Problem: running t2409-sdexec.t under valgrind turned up this leak: ==3040827== 86 (80 direct, 6 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 7 ==3040827== at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==3040827== by 0x83D415F: sdexec_channel_create (channel.c:140) ==3040827== by 0x83D42CC: sdexec_channel_create_input (channel.c:189) ==3040827== by 0x83D2040: sdproc_create (sdexec.c:511) ==3040827== by 0x83D2040: exec_cb (sdexec.c:587) ==3040827== by 0x4880407: call_handler (msg_handler.c:345) ==3040827== by 0x4880799: dispatch_message (msg_handler.c:381) ==3040827== by 0x4880799: handle_cb (msg_handler.c:482) ==3040827== by 0x48B4DA2: ev_invoke_pending (ev.c:3770) ==3040827== by 0x48B884F: ev_run (ev.c:4190) ==3040827== by 0x48B884F: ev_run (ev.c:4021) ==3040827== by 0x487F48E: flux_reactor_run (reactor.c:128) ==3040827== by 0x83D253B: mod_main (sdexec.c:1022) ==3040827== by 0x11EEC0: module_thread (module.c:185) ==3040827== by 0x4BACB42: start_thread (pthread_create.c:442) Free the input channel when the sdproc is destroyed.
1 parent 823b8a1 commit 1927971

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/modules/sdexec/sdexec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ static void sdproc_destroy (struct sdproc *proc)
390390
{
391391
if (proc) {
392392
int saved_errno = errno;
393+
sdexec_channel_destroy (proc->in);
393394
sdexec_channel_destroy (proc->out);
394395
sdexec_channel_destroy (proc->err);
395396
if (proc->f_watch) {

0 commit comments

Comments
 (0)