]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Use ToolsCmd_FreeRPC() to free the memory instead of vm_free.
authorOliver Kurth <okurth@vmware.com>
Mon, 20 Aug 2018 19:48:08 +0000 (12:48 -0700)
committerOliver Kurth <okurth@vmware.com>
Mon, 20 Aug 2018 19:48:08 +0000 (12:48 -0700)
There exists a function ToolsCmd_FreeRPC that can be called to free
the memory allocated from the ToolsCmd_SendRPC function call.

At few places in the code, vm_free is used to free the memory.
Replaced those references with ToolsCmd_FreeRPC.

open-vm-tools/toolbox/toolboxcmd-info.c
open-vm-tools/toolbox/toolboxcmd-time.c

index 6dfb843af0645bc7dde8b0fe8e3d11d61bbe68c6..10903ec222c99289a923a53e94b36296445db477 100644 (file)
@@ -79,7 +79,7 @@ InfoSendNetworkXdr(GuestNicProto *message,
          g_warning("%s: update failed: request \"%s\", reply \"%s\".\n",
                     __FUNCTION__, request, reply);
       }
-      vm_free(reply);
+      ToolsCmd_FreeRPC(reply);
    }
    DynXdr_Destroy(&xdrs, TRUE);
 
index d7848f120f1612efe34391c3cc29e9e551757991..c056de429575e705eb00c76fba2355bdd8ac7a94 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2008-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2018 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -28,7 +28,6 @@
 #include "vmware/guestrpc/tclodefs.h"
 #include "vmware/guestrpc/timesync.h"
 #include "vmware/tools/i18n.h"
-#include "vmware/tools/utils.h"
 
 
 /*
@@ -118,7 +117,7 @@ TimeSyncEnable(void)
       ret = EXIT_FAILURE;
    }
 
-   vm_free(reply);
+   ToolsCmd_FreeRPC(reply);
    return ret;
 }
 
@@ -154,7 +153,7 @@ TimeSyncDisable(void)
       ret = EXIT_FAILURE;
    }
 
-   vm_free(reply);
+   ToolsCmd_FreeRPC(reply);
    return ret;
 }