summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2011-11-05 22:19:31 -0700
committerVinson Lee <[email protected]>2011-11-07 20:36:07 -0800
commitf4515d106cd40351133c89855e3277a70bba8721 (patch)
tree0e66054ce9c2bee970070e4e6591b79c166d2e88 /src/gallium/state_trackers
parent5c02e2e2de75b9d18ca25b4f1cba38c4a89c5bd0 (diff)
st/dri: Fix memory leak on error path.
Fixes Coverity resource leak defect. Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/dri/drm/dri2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index a6bf3c1e10f..4e3f1067ce2 100644
--- 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;