diff --git a/src/opennebula/one_client.c b/src/opennebula/one_client.c index d1641bf024c7e8ba8d42bf0b3515a826483f3958..21f303a64bae87d1f83269e88c166cee8d18e712 100644 --- a/src/opennebula/one_client.c +++ b/src/opennebula/one_client.c @@ -176,6 +176,7 @@ int c_oneVmInfo(int vmid, char* ret_info,int length) xmlrpc_value *resultP; int return_code; char *return_string; + int retval = -1; resultP = xmlrpc_client_call(&one_client.env, one_client.url, "one.vmget_info", "(si)", one_client.session, vmid); @@ -188,18 +189,13 @@ int c_oneVmInfo(int vmid, char* ret_info,int length) strncpy(ret_info, return_string, length-1); ret_info[length-1] = '\0'; - xmlrpc_DECREF(resultP); - free(return_string); - - return 0; + retval = 0; } - else - { - xmlrpc_DECREF(resultP); - free(return_string); - return -1; - } + xmlrpc_DECREF(resultP); + free(return_string); + + return retval; } void c_oneFree()