projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c02e2e
)
st/dri: Fix memory leak on error path.
author
Vinson Lee
<vlee@vmware.com>
Sun, 6 Nov 2011 05:19:31 +0000
(22:19 -0700)
committer
Vinson Lee
<vlee@vmware.com>
Tue, 8 Nov 2011 04:36:07 +0000
(20:36 -0800)
Fixes Coverity resource leak defect.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/state_trackers/dri/drm/dri2.c
patch
|
blob
|
history
diff --git
a/src/gallium/state_trackers/dri/drm/dri2.c
b/src/gallium/state_trackers/dri/drm/dri2.c
index a6bf3c1e10fbafe927fc0fba5bc66a01117274d5..4e3f1067ce24809b044c862fc00b381834ac1a83 100644
(file)
--- a/
src/gallium/state_trackers/dri/drm/dri2.c
+++ b/
src/gallium/state_trackers/dri/drm/dri2.c
@@
-306,8
+306,10
@@
dri2_allocate_buffer(__DRIscreen *sPriv,
buffer->resource =
screen->base.screen->resource_create(screen->base.screen, &templ);
- if (!buffer->resource)
+ if (!buffer->resource) {
+ FREE(buffer);
return NULL;
+ }
memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_SHARED;