[Spice-commits] src/channel-display.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 10 12:02:10 UTC 2020


 src/channel-display.c |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 97c43efb4e46ef49f3ff2e0a859e247e8984223e
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Thu Sep 10 11:49:00 2020 +0100

    channel-display: Remove leak if surface is reused
    
    "surface" parameters is normally attached to "surfaces" hash table
    but in case surface is reused the buffer is not freed.
    
    This problem was reported by Ding Fei.
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
    Acked-by: Marc-André Lureau <marcandre.lureau at redhat.com>

diff --git a/src/channel-display.c b/src/channel-display.c
index 3340912..023baa1 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -993,6 +993,7 @@ static int create_canvas(SpiceChannel *channel, display_surface *surface)
         if (c->primary) {
             if (c->primary->width == surface->width &&
                 c->primary->height == surface->height) {
+                g_free(surface);
                 CHANNEL_DEBUG(channel, "Reusing existing primary surface");
                 return 0;
             }


More information about the Spice-commits mailing list