]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix memory leak issue for "vmtoolsd" binary on receiving SIGINT or SIGUSR1.
authorJohn Wolfe <jwolfe@vmware.com>
Tue, 21 Jul 2020 18:53:01 +0000 (11:53 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Tue, 21 Jul 2020 18:53:01 +0000 (11:53 -0700)
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.

open-vm-tools/lib/rpcChannel/rpcChannel.c

index 111efa40dc47bcb81ce154895df187470e060645..236ed8635ab74b605c5163e44375dbf092af5fed 100644 (file)
@@ -582,6 +582,11 @@ RpcChannelTeardown(RpcChannel *chan)
       cdata->resetCheck = NULL;
    }
 
+   if (chan->in != NULL) {
+      RpcIn_Destruct(chan->in);
+      chan->in = NULL;
+   }
+
    cdata->rpcInInitialized = FALSE;
 }