summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/egl_dri2.c
diff options
context:
space:
mode:
authorVölgyes Dávid <[email protected]>2011-07-06 10:10:20 -0400
committerKristian Høgsberg <[email protected]>2011-07-06 10:11:04 -0400
commitf747d03b1d3aa4e63417bd8486909f63b4a33be4 (patch)
tree045c4ea814b6d54315f033d41eb098f1e9a1da82 /src/egl/drivers/dri2/egl_dri2.c
parente53b41f2632af26c79c4f7ed5b0fdb86a1feb602 (diff)
Fixes for leaks reported by cppcheck.
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.c')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 5680c360f1d..35a598ecab8 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -923,8 +923,10 @@ dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
return EGL_NO_IMAGE_KHR;
}
- if (!_eglInitImage(&dri2_img->base, disp))
+ if (!_eglInitImage(&dri2_img->base, disp)) {
+ free(dri2_img);
return EGL_NO_IMAGE_KHR;
+ }
dri2_img->dri_image =
dri2_dpy->image->createImageFromRenderbuffer(dri2_ctx->dri_context,
@@ -1335,8 +1337,10 @@ _EGL_MAIN(const char *args)
memset(dri2_drv, 0, sizeof *dri2_drv);
- if (!dri2_load(&dri2_drv->base))
+ if (!dri2_load(&dri2_drv->base)) {
+ free(dri2_drv);
return NULL;
+ }
_eglInitDriverFallbacks(&dri2_drv->base);
dri2_drv->base.API.Initialize = dri2_initialize;