mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
vz: vzEatCookie: use distinct 'tmp' variables
Mark both as g_autofree within their separate scopes. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
8640574a2b
commit
3ac9e0edf7
@ -2790,7 +2790,6 @@ vzEatCookie(const char *cookiein, int cookieinlen, unsigned int flags)
|
|||||||
{
|
{
|
||||||
xmlDocPtr doc = NULL;
|
xmlDocPtr doc = NULL;
|
||||||
xmlXPathContextPtr ctx = NULL;
|
xmlXPathContextPtr ctx = NULL;
|
||||||
char *tmp = NULL;
|
|
||||||
vzMigrationCookiePtr mig = NULL;
|
vzMigrationCookiePtr mig = NULL;
|
||||||
|
|
||||||
if (VIR_ALLOC(mig) < 0)
|
if (VIR_ALLOC(mig) < 0)
|
||||||
@ -2807,29 +2806,29 @@ vzEatCookie(const char *cookiein, int cookieinlen, unsigned int flags)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (flags & VZ_MIGRATION_COOKIE_SESSION_UUID) {
|
if (flags & VZ_MIGRATION_COOKIE_SESSION_UUID) {
|
||||||
|
g_autofree char *tmp = NULL;
|
||||||
|
|
||||||
if ((!(tmp = virXPathString("string(./session-uuid[1])", ctx))
|
if ((!(tmp = virXPathString("string(./session-uuid[1])", ctx))
|
||||||
|| (VIR_ALLOC_N(mig->session_uuid, VIR_UUID_BUFLEN) < 0)
|
|| (VIR_ALLOC_N(mig->session_uuid, VIR_UUID_BUFLEN) < 0)
|
||||||
|| (virUUIDParse(tmp, mig->session_uuid) < 0))) {
|
|| (virUUIDParse(tmp, mig->session_uuid) < 0))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("missing or malformed session-uuid element "
|
_("missing or malformed session-uuid element "
|
||||||
"in migration data"));
|
"in migration data"));
|
||||||
VIR_FREE(tmp);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VIR_FREE(tmp);
|
|
||||||
|
|
||||||
if (flags & VZ_MIGRATION_COOKIE_DOMAIN_UUID) {
|
if (flags & VZ_MIGRATION_COOKIE_DOMAIN_UUID) {
|
||||||
|
g_autofree char *tmp = NULL;
|
||||||
|
|
||||||
if ((!(tmp = virXPathString("string(./uuid[1])", ctx))
|
if ((!(tmp = virXPathString("string(./uuid[1])", ctx))
|
||||||
|| (VIR_ALLOC_N(mig->uuid, VIR_UUID_BUFLEN) < 0)
|
|| (VIR_ALLOC_N(mig->uuid, VIR_UUID_BUFLEN) < 0)
|
||||||
|| (virUUIDParse(tmp, mig->uuid) < 0))) {
|
|| (virUUIDParse(tmp, mig->uuid) < 0))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("missing or malformed uuid element in migration data"));
|
_("missing or malformed uuid element in migration data"));
|
||||||
VIR_FREE(tmp);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VIR_FREE(tmp);
|
|
||||||
|
|
||||||
if ((flags & VZ_MIGRATION_COOKIE_DOMAIN_NAME)
|
if ((flags & VZ_MIGRATION_COOKIE_DOMAIN_NAME)
|
||||||
&& !(mig->name = virXPathString("string(./name[1])", ctx))) {
|
&& !(mig->name = virXPathString("string(./name[1])", ctx))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user