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>
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);