/*********************************************************
- * Copyright (C) 2012-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2012-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
GetVmVcUuidFromVmx(void)
{
char *vcUuid;
- char *reply;
+ char *reply = NULL;
size_t replyLen;
gboolean ok;
gchar *msg = "xrabbitmqProxy.getVmVcUuid";
if (!ok) {
g_warning("Guest rpc call to VMX failed, "
"cannot retrieve vc uuid from vmx.\n");
+ RpcChannel_Free(reply);
return NULL;
}
if (replyLen > VC_UUID_SIZE) {
g_warning("Guest rpc call to VMX failed, "
"the returned vc uuid too large.\n");
+ RpcChannel_Free(reply);
return NULL;
}
g_info("Guest rpc call to VMX, retrieved vc uuid %s\n",
vcUuid);
+ RpcChannel_Free(reply);
return vcUuid;
}
/*********************************************************
- * 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
}
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * ToolsCmd_FreeRPC --
+ *
+ * Free the memory allocated for the results from
+ * ToolsCmd_SendRPC calls.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+ToolsCmd_FreeRPC(void *ptr) // IN
+{
+ RpcChannel_Free(ptr);
+}
+
+
/*
*-----------------------------------------------------------------------------
*
/*********************************************************
- * 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
char **result,
size_t *resultLen);
+void
+ToolsCmd_FreeRPC(void *ptr);
+
/*
* Command declarations.
*/
state = WIPER_DISABLED;
}
}
- free(result);
+ ToolsCmd_FreeRPC(result);
return state;
}
static int
ShrinkDiskSendRPC(void)
{
- char *result;
+ char *result = NULL;
size_t resultLen;
+ int retVal;
ToolsCmd_PrintErr("\n");
&result, &resultLen)) {
ToolsCmd_Print("%s",
SU_(disk.shrink.complete, "Disk shrinking complete.\n"));
- return EXIT_SUCCESS;
+ retVal = EXIT_SUCCESS;
+ } else {
+ ToolsCmd_PrintErr(SU_(disk.shrink.error,
+ "Error while shrinking: %s\n"), result);
+ retVal = EX_TEMPFAIL;
}
- ToolsCmd_PrintErr(SU_(disk.shrink.error, "Error while shrinking: %s\n"), result);
- return EX_TEMPFAIL;
+ ToolsCmd_FreeRPC(result);
+ return retVal;
}