aboutsummaryrefslogtreecommitdiff
path: root/xen-all.c
diff options
context:
space:
mode:
Diffstat (limited to 'xen-all.c')
-rw-r--r--xen-all.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xen-all.c b/xen-all.c
index bc105f1627..1a1d7bbdcc 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -389,7 +389,7 @@ static int xen_remove_from_physmap(XenIOState *state,
if (state->log_for_dirtybit == physmap) {
state->log_for_dirtybit = NULL;
}
- free(physmap);
+ g_free(physmap);
return 0;
}
@@ -1030,7 +1030,7 @@ static void xen_read_physmap(XenIOState *state)
xen_domid, entries[i]);
value = xs_read(state->xenstore, 0, path, &len);
if (value == NULL) {
- free(physmap);
+ g_free(physmap);
continue;
}
physmap->start_addr = strtoull(value, NULL, 16);
@@ -1041,7 +1041,7 @@ static void xen_read_physmap(XenIOState *state)
xen_domid, entries[i]);
value = xs_read(state->xenstore, 0, path, &len);
if (value == NULL) {
- free(physmap);
+ g_free(physmap);
continue;
}
physmap->size = strtoull(value, NULL, 16);
@@ -1069,12 +1069,14 @@ int xen_hvm_init(void)
state->xce_handle = xen_xc_evtchn_open(NULL, 0);
if (state->xce_handle == XC_HANDLER_INITIAL_VALUE) {
perror("xen: event channel open");
+ g_free(state);
return -errno;
}
state->xenstore = xs_daemon_open();
if (state->xenstore == NULL) {
perror("xen: xenstore open");
+ g_free(state);
return -errno;
}