diff options
author | Dmitry Osipenko <digetx@gmail.com> | 2018-01-05 17:35:00 +0300 |
---|---|---|
committer | Dmitry Osipenko <digetx@gmail.com> | 2018-01-07 19:19:38 +0300 |
commit | 611d008845e7db591a323a7830dfa82cb22845bd (patch) | |
tree | f90bff97ad1858ec9de6f3d35a88e28e97d4a553 | |
parent | 8fc683ce2524cac899869ec9b1e306fb0315c58c (diff) |
Correct cleanup on shared surface creation error
-rw-r--r-- | src/surface_shared.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/surface_shared.c b/src/surface_shared.c index 171e5be..8e5f469 100644 --- a/src/surface_shared.c +++ b/src/surface_shared.c @@ -125,7 +125,11 @@ tegra_shared_surface *create_shared_surface(tegra_surface *disp, ret = dynamic_release_surface_data(disp); if (ret) { - free(shared->xv_img); + if (shared->xv_img) { + free(shared->xv_img->data); + XFree(shared->xv_img); + } + free(shared); pthread_mutex_unlock(&disp->lock); |