summaryrefslogtreecommitdiffstats
path: root/src/loader/loader_dri3_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/loader/loader_dri3_helper.c')
-rw-r--r--src/loader/loader_dri3_helper.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
index fbda3d635c7..2912bb6749b 100644
--- a/src/loader/loader_dri3_helper.c
+++ b/src/loader/loader_dri3_helper.c
@@ -1288,7 +1288,10 @@ loader_dri3_create_image(xcb_connection_t *c,
ret = image->fromPlanar(image_planar, 0, loaderPrivate);
- image->destroyImage(image_planar);
+ if (!ret)
+ ret = image_planar;
+ else
+ image->destroyImage(image_planar);
return ret;
}