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>
main
Ville Syrjälä 2012-02-02 14:53:39 -05:00 committed by Jerome Glisse
parent c51f7f0e46
commit df497e9281
1 changed files with 6 additions and 0 deletions

View File

@ -96,6 +96,10 @@ void drmModeFreeResources(drmModeResPtr ptr)
if (!ptr) if (!ptr)
return; return;
drmFree(ptr->fbs);
drmFree(ptr->crtcs);
drmFree(ptr->connectors);
drmFree(ptr->encoders);
drmFree(ptr); drmFree(ptr);
} }
@ -898,6 +902,7 @@ retry:
ovr.count_format_types, sizeof(uint32_t)); ovr.count_format_types, sizeof(uint32_t));
if (ovr.count_format_types && !r->formats) { if (ovr.count_format_types && !r->formats) {
drmFree(r->formats); drmFree(r->formats);
drmFree(r);
r = 0; r = 0;
} }
@ -951,6 +956,7 @@ retry:
res.count_planes, sizeof(uint32_t)); res.count_planes, sizeof(uint32_t));
if (res.count_planes && !r->planes) { if (res.count_planes && !r->planes) {
drmFree(r->planes); drmFree(r->planes);
drmFree(r);
r = 0; r = 0;
} }