[Spice-devel] [PATCH spice-gtk 13/14] channel: unref incoming migrate data
Marc-André Lureau
marcandre.lureau at gmail.com
Thu Sep 12 05:09:21 PDT 2013
---
gtk/channel-base.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/gtk/channel-base.c b/gtk/channel-base.c
index abcf9d9..646042d 100644
--- a/gtk/channel-base.c
+++ b/gtk/channel-base.c
@@ -169,12 +169,12 @@ void spice_channel_handle_migrate(SpiceChannel *channel, SpiceMsgIn *in)
spice_channel_recv_msg(channel, get_msg_handler, &data);
if (!data) {
g_critical("expected SPICE_MSG_MIGRATE_DATA, got empty message");
- return;
+ goto end;
} else if (spice_header_get_msg_type(data->header, c->use_mini_header) !=
SPICE_MSG_MIGRATE_DATA) {
g_critical("expected SPICE_MSG_MIGRATE_DATA, got %d",
spice_header_get_msg_type(data->header, c->use_mini_header));
- return;
+ goto end;
}
}
@@ -187,8 +187,11 @@ void spice_channel_handle_migrate(SpiceChannel *channel, SpiceMsgIn *in)
spice_marshaller_add(out->marshaller, data->data,
spice_header_get_msg_size(data->header, c->use_mini_header));
spice_msg_out_send_internal(out);
- /* FIXME: who unref in? */
}
+
+end:
+ if (data)
+ spice_msg_in_unref(data);
}
--
1.8.3.1
More information about the Spice-devel
mailing list