rpc: Don't use unrelated value as privateData of client

Append privateData of the client only if there are any, otherwise the
previous value (socket data) will get there again.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Daniel P. Berrange 2015-06-04 19:16:32 +02:00 committed by Martin Kletzander
parent 404094187a
commit 2128d2e920

View File

@ -536,13 +536,14 @@ virJSONValuePtr virNetServerClientPreExecRestart(virNetServerClientPtr client)
goto error;
}
if (client->privateData && client->privateDataPreExecRestart &&
!(child = client->privateDataPreExecRestart(client, client->privateData)))
goto error;
if (client->privateData && client->privateDataPreExecRestart) {
if (!(child = client->privateDataPreExecRestart(client, client->privateData)))
goto error;
if (virJSONValueObjectAppend(object, "privateData", child) < 0) {
virJSONValueFree(child);
goto error;
if (virJSONValueObjectAppend(object, "privateData", child) < 0) {
virJSONValueFree(child);
goto error;
}
}
virObjectUnlock(client);