summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2013-08-26 00:44:02 +0100
committerRussell King <rmk@arm.linux.org.uk>2013-10-29 19:21:08 +0000
commit7e9ef8cb983d37a1fc31dc7d75581c0aab4b8db2 (patch)
tree80a1fe493756e5f7565aad8d71968a3da9f8b3fd
parent77e0267aac890015d72a2c846b2db46a057dbbcb (diff)
Fix bad error cleanup in vivante_accel_PutImage
We need to use the original pointer when unmapping memory, and don't forget to free the buffer if we allocated one. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--src/vivante_accel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vivante_accel.c b/src/vivante_accel.c
index f9144bb..fe6f9b3 100644
--- a/src/vivante_accel.c
+++ b/src/vivante_accel.c
@@ -671,7 +671,9 @@ Bool vivante_accel_PutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
return TRUE;
unmap:
- gcoOS_UnmapUserMemory(vivante->os, bits, size, info, addr);
+ gcoOS_UnmapUserMemory(vivante->os, buf, size, info, addr);
+ if (buf != bits)
+ free(buf);
return FALSE;
}