summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-09-13 18:21:37 +0900
committerMichel Dänzer <michel@daenzer.net>2016-09-21 18:20:19 +0900
commitcf52c76484a4adfa3e0b2271ea0c00f46d32ca48 (patch)
tree90640a538cc63243d9f44c49f27a23d3498eb9c7
parent50abcc19e29bb50451d031b2c9e99d691d4faf70 (diff)
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 <qiang.yu@amd.com> (Ported from amdgpu commit 7f7f9825caf3983902491da27c16d14cd8bf9b7d)
-rw-r--r--src/radeon.h7
1 files changed, 4 insertions, 3 deletions
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);