From cf52c76484a4adfa3e0b2271ea0c00f46d32ca48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 13 Sep 2016 18:21:37 +0900 Subject: Free priv in amdgpu_set_pixmap_bo also if priv->bo == NULL Fixes memory leak when destroying pixmaps with priv->bo == NULL. Reported-by: Qiang Yu (Ported from amdgpu commit 7f7f9825caf3983902491da27c16d14cd8bf9b7d) --- src/radeon.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/radeon.h b/src/radeon.h index c914a585..0bf6d372 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -691,11 +691,12 @@ static inline Bool radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo) return TRUE; if (priv) { - if (priv->bo == bo) - return TRUE; + if (priv->bo) { + if (priv->bo == bo) + return TRUE; - if (priv->bo) radeon_bo_unref(priv->bo); + } if (!bo) { free(priv); -- cgit v1.2.3