]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Additional changes for the network interface limit logging.
authorJohn Wolfe <jwolfe@vmware.com>
Thu, 20 May 2021 18:38:38 +0000 (11:38 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Thu, 20 May 2021 18:38:38 +0000 (11:38 -0700)
1) Use the VM_SAFE_STR macro for string null check.
2) Since free() is NULL safe, remove the "if" check before the free().
3) Fix an alignment issue.

open-vm-tools/libvmtools/vmtoolsLog.c

index 5605cf03962b3ecd9df73b0b02351b5f68582d85..2162efd6f35529e06443d710467b0d0480db05f3 100644 (file)
@@ -2764,11 +2764,9 @@ VMTools_VmxLog(RpcChannel *chan,
 
    if (!RpcChannel_Send(chan, msg, len + 1, &reply, &replyLen)) {
       g_warning("%s: Error sending RPC message: %s. reply: %s\n",
-                __FUNCTION__, msg, reply ? reply : "NULL");
-   }
-   if (reply) {
-      free(reply);
+                __FUNCTION__, msg, VM_SAFE_STR(reply));
    }
+   free(reply);
 
    g_message("%s\n", msg + VMX_LOG_CMD_LEN);
 }