aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä2012-02-02 13:53:39 -0600
committerJerome Glisse2012-02-02 13:53:39 -0600
commitdf497e9281036ca9397bc5a08a82fdf44dbc12b2 (patch)
treeb10f8d5847526a8d6c68a6dcd2d1b9221d3545cd /xf86drmMode.c
parentc51f7f0e460dcadb9f1a56ecf1615810877c33c8 (diff)
downloadexternal-libgbm-df497e9281036ca9397bc5a08a82fdf44dbc12b2.tar.gz
external-libgbm-df497e9281036ca9397bc5a08a82fdf44dbc12b2.tar.xz
external-libgbm-df497e9281036ca9397bc5a08a82fdf44dbc12b2.zip
drmModeFreeResources() always leaked some memory.
drmModeGetPlaneResources() and drmModeGetPlane() leaked in one error path. Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Diffstat (limited to 'xf86drmMode.c')
-rw-r--r--xf86drmMode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xf86drmMode.c b/xf86drmMode.c
index da7b4620..e67ed4a3 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -96,6 +96,10 @@ void drmModeFreeResources(drmModeResPtr ptr)
96 if (!ptr) 96 if (!ptr)
97 return; 97 return;
98 98
99 drmFree(ptr->fbs);
100 drmFree(ptr->crtcs);
101 drmFree(ptr->connectors);
102 drmFree(ptr->encoders);
99 drmFree(ptr); 103 drmFree(ptr);
100 104
101} 105}
@@ -898,6 +902,7 @@ retry:
898 ovr.count_format_types, sizeof(uint32_t)); 902 ovr.count_format_types, sizeof(uint32_t));
899 if (ovr.count_format_types && !r->formats) { 903 if (ovr.count_format_types && !r->formats) {
900 drmFree(r->formats); 904 drmFree(r->formats);
905 drmFree(r);
901 r = 0; 906 r = 0;
902 } 907 }
903 908
@@ -951,6 +956,7 @@ retry:
951 res.count_planes, sizeof(uint32_t)); 956 res.count_planes, sizeof(uint32_t));
952 if (res.count_planes && !r->planes) { 957 if (res.count_planes && !r->planes) {
953 drmFree(r->planes); 958 drmFree(r->planes);
959 drmFree(r);
954 r = 0; 960 r = 0;
955 } 961 }
956 962