]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix some leaks found by valgrind.
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:44 +0000 (11:22 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:44 +0000 (11:22 -0700)
  - leaking the 'data' pref value for a log handler.
  - leaking an rpc message response if the caller doesn't want it.
  - leaking username/password for every guestOp

open-vm-tools/lib/rpcChannel/rpcChannel.c
open-vm-tools/libvmtools/vmtoolsLog.c
open-vm-tools/services/plugins/vix/vixTools.c

index 39cd63cea6b1eb6514448bc30bfc22f4a8f7c4c1..9eb7f31098e77be27876c6f076e901e8332a93ed 100644 (file)
@@ -896,6 +896,8 @@ done:
 
    if (result != NULL) {
       *result = res;
+   } else {
+      free(res);
    }
    if (resultLen != NULL) {
       *resultLen = resLen;
index 381797ac430792b124be0efc90017d2cbfc2952c..647ec48c1360cbbb02ce3385c974d8197435ab53 100644 (file)
@@ -875,6 +875,7 @@ VMToolsConfigLogDomain(const gchar *domain,
 exit:
    g_free(handler);
    g_free(level);
+   g_free(confData);
 }
 
 
index 4c0995b12aae619e1f1ad096490d5a00e3ae2094..aa8538a30515f0dd845af7df77a5f802daa15575 100644 (file)
@@ -11327,8 +11327,8 @@ GuestAuthPasswordAuthenticateImpersonate(
 {
 #if SUPPORT_VGAUTH
    VixError err;
-   char *username;
-   char *password;
+   char *username = NULL;
+   char *password = NULL;
    VGAuthContext *ctx = NULL;
    VGAuthError vgErr;
    VGAuthUserHandle *newHandle = NULL;
@@ -11377,6 +11377,8 @@ GuestAuthPasswordAuthenticateImpersonate(
    err = VIX_OK;
 
 done:
+   free(username);
+   Util_ZeroFreeString(password);
 
    return err;
 #else