[Spice-devel] [PATCH spice-server v2 7/7] fixup! Convert RedChannelClient hierarchy to GObject
Frediano Ziglio
fziglio at redhat.com
Fri Sep 30 13:21:52 UTC 2016
Remove old arrays if present.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
server/red-channel-client.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/server/red-channel-client.c b/server/red-channel-client.c
index 5b209d8..546d58d 100644
--- a/server/red-channel-client.c
+++ b/server/red-channel-client.c
@@ -201,6 +201,7 @@ red_channel_client_set_property(GObject *object,
GArray *caps = g_value_get_boxed(value);
if (caps) {
self->priv->remote_caps.num_common_caps = caps->len;
+ free(self->priv->remote_caps.common_caps);
self->priv->remote_caps.common_caps = spice_memdup(caps->data, caps->len * sizeof(uint32_t));
}
}
@@ -210,6 +211,7 @@ red_channel_client_set_property(GObject *object,
GArray *caps = g_value_get_boxed(value);
if (caps) {
self->priv->remote_caps.num_caps = caps->len;
+ free(self->priv->remote_caps.caps);
self->priv->remote_caps.caps = spice_memdup(caps->data, caps->len * sizeof(uint32_t));
}
}
--
2.7.4
More information about the Spice-devel
mailing list