diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2011-05-27 21:06:02 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-05-28 21:44:30 +0200 |
commit | cccf4baae9493a7e8a016d83288481fbb88b2ac0 (patch) | |
tree | 6068026bab40ae8ff2537b44df6d997ba447e3f8 /gtk/channel-main.c | |
parent | 1ae6c189130cddc7d497292151f39fe95b517a60 (diff) |
plug a memleak in ChannelMain::_channel_new
ChannelMain::_channel_new was leaking memory in an error path.
Unconditionnally free the used memory, which has the added benefit
of making the code simpler.
Diffstat (limited to 'gtk/channel-main.c')
-rw-r--r-- | gtk/channel-main.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gtk/channel-main.c b/gtk/channel-main.c index 6897a18..7df37b8 100644 --- a/gtk/channel-main.c +++ b/gtk/channel-main.c @@ -1125,13 +1125,9 @@ typedef struct channel_new { /* main context */ static gboolean _channel_new(channel_new_t *c) { - SpiceChannel *channel; - g_return_val_if_fail(c != NULL, FALSE); - channel = spice_channel_new(c->session, c->type, c->id); - if (channel == NULL) - return FALSE; + spice_channel_new(c->session, c->type, c->id); g_object_unref(c->session); g_free(c); |