From: John Wolfe Date: Tue, 21 Jul 2020 18:53:01 +0000 (-0700) Subject: Fix memory leak issue for "vmtoolsd" binary on receiving SIGINT or SIGUSR1. X-Git-Tag: stable-11.2.0~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44ad3675a33b804dd262bfab3279410aff442bcc;p=thirdparty%2Fopen-vm-tools.git Fix memory leak issue for "vmtoolsd" binary on receiving SIGINT or SIGUSR1. Valgrind complains of a memory leak issue on receiving SIGINT or SIGUSR1 signal, because we lost call to RpcIn_Destruct(chan->in) in RpcChannelTeardown(). It just happens to be released only at service shutdown or on receiving SIGUSR1 signal; not a major concern. Cleaning up the code. --- diff --git a/open-vm-tools/lib/rpcChannel/rpcChannel.c b/open-vm-tools/lib/rpcChannel/rpcChannel.c index 111efa40d..236ed8635 100644 --- a/open-vm-tools/lib/rpcChannel/rpcChannel.c +++ b/open-vm-tools/lib/rpcChannel/rpcChannel.c @@ -582,6 +582,11 @@ RpcChannelTeardown(RpcChannel *chan) cdata->resetCheck = NULL; } + if (chan->in != NULL) { + RpcIn_Destruct(chan->in); + chan->in = NULL; + } + cdata->rpcInInitialized = FALSE; }