mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
Minor cleanup of error path for c_oneVmInfo.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
This commit is contained in:
parent
b216dd41d7
commit
9be5773fbb
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user