From 59b20b760d63dad15d4d62a43bae8b7e26085c79 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Sat, 3 Oct 2009 17:56:51 +0200 Subject: [PATCH] r300g: Fix memory leak in radeon_texture_from_shared_handle MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/gallium/winsys/drm/radeon/core/radeon_drm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index a4011db0b87..caab33de1cc 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -107,13 +107,18 @@ radeon_texture_from_shared_handle(struct drm_api *api, unsigned handle) { struct pipe_buffer *buffer; + struct pipe_texture *blanket; buffer = radeon_buffer_from_handle(api, screen, name, handle); if (!buffer) { return NULL; } - return screen->texture_blanket(screen, templ, &stride, buffer); + blanket = screen->texture_blanket(screen, templ, &stride, buffer); + + pipe_buffer_reference(&buffer, NULL); + + return blanket; } static boolean radeon_shared_handle_from_texture(struct drm_api *api, -- 2.30.2