From: John Wolfe Date: Thu, 20 May 2021 18:38:38 +0000 (-0700) Subject: Additional changes for the network interface limit logging. X-Git-Tag: stable-11.3.0~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abfd599dea18f0f6a5acc35d539cec0322d194df;p=thirdparty%2Fopen-vm-tools.git Additional changes for the network interface limit logging. 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. --- diff --git a/open-vm-tools/libvmtools/vmtoolsLog.c b/open-vm-tools/libvmtools/vmtoolsLog.c index 5605cf039..2162efd6f 100644 --- a/open-vm-tools/libvmtools/vmtoolsLog.c +++ b/open-vm-tools/libvmtools/vmtoolsLog.c @@ -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); }