[Spice-devel] [PATCH spice-server 2/9] reds: Remove leak of agent_dev
Victor Toso
victortoso at redhat.com
Tue Dec 5 09:12:13 UTC 2017
Hi,
On Tue, Dec 05, 2017 at 08:41:05AM +0000, Frediano Ziglio wrote:
> This object was not freed.
AND, you are fixing the leak in the object itself, no?
One patch should be fine but adding that in commit log should do no
harm.
Still,
Acked-by: Victor Toso <victortoso at redhat.com>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> server/reds.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/server/reds.c b/server/reds.c
> index 4e652253..40c82ccc 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3754,6 +3754,7 @@ SPICE_GNUC_VISIBLE void spice_server_destroy(SpiceServer *reds)
> reds_core_watch_remove(reds, reds->secure_listen_watch);
> close(reds->secure_listen_socket);
> }
> + g_clear_object(&reds->agent_dev);
> spice_buffer_free(&reds->client_monitors_config);
> red_record_unref(reds->record);
> reds_cleanup(reds);
> @@ -4535,8 +4536,14 @@ red_char_device_vdi_port_finalize(GObject *object)
> {
> RedCharDeviceVDIPort *dev = RED_CHAR_DEVICE_VDIPORT(object);
>
> + /* make sure we have no other references to RedVDIReadBuf buffers */
> + red_char_device_reset(RED_CHAR_DEVICE(dev));
> + if (dev->priv->current_read_buf) {
> + red_pipe_item_unref(&dev->priv->current_read_buf->base);
> + dev->priv->current_read_buf = NULL;
> + }
> + g_list_free_full(dev->priv->read_bufs, g_free);
> g_free(dev->priv->mig_data);
> - /* FIXME: need to free the RedVDIReadBuf allocated previously */
>
> G_OBJECT_CLASS(red_char_device_vdi_port_parent_class)->finalize(object);
> }
> --
> 2.14.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20171205/36d9a1a0/attachment-0001.sig>
More information about the Spice-devel
mailing list