summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoram Park <boram1288.park@samsung.com>2017-09-27 10:28:12 +0900
committerBoram Park <boram1288.park@samsung.com>2017-09-27 10:28:12 +0900
commitbf71820a7c7f81659428f7973147541e9bb85c4d (patch)
tree692104e82d8be0efbe4482f69bd45c783adf8ed1
parent6df3a17f01d39d6b254c4bd3bd2c453d996753b8 (diff)
downloadlibtdm-drm-bf71820a7c7f81659428f7973147541e9bb85c4d.tar.gz
libtdm-drm-bf71820a7c7f81659428f7973147541e9bb85c4d.tar.bz2
libtdm-drm-bf71820a7c7f81659428f7973147541e9bb85c4d.zip
fix memory leak
Change-Id: Id4596ea2b776659f16454a44b5d37135f9ac124b
-rw-r--r--src/tdm_drm_display.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tdm_drm_display.c b/src/tdm_drm_display.c
index fe4d75a..d9304eb 100644
--- a/src/tdm_drm_display.c
+++ b/src/tdm_drm_display.c
@@ -851,6 +851,7 @@ tdm_drm_display_create_output_list(tdm_drm_data *drm_data)
if (crtc_id == 0) {
TDM_ERR("no possible crtc");
drmModeFreeConnector(connector);
+ drmModeFreeEncoder(encoder);
ret = TDM_ERROR_OPERATION_FAILED;
goto failed_create;
}
@@ -1533,10 +1534,14 @@ drm_layer_get_capability(tdm_layer *layer, tdm_caps_layer *caps)
drmModePropertyPtr prop = drmModeGetProperty(drm_data->drm_fd, props->props[i]);
if (!prop)
continue;
- if (!strncmp(prop->name, "type", TDM_NAME_LEN))
+ if (!strncmp(prop->name, "type", TDM_NAME_LEN)) {
+ drmModeFreeProperty(prop);
continue;
- if (!strncmp(prop->name, "zpos", TDM_NAME_LEN))
+ }
+ if (!strncmp(prop->name, "zpos", TDM_NAME_LEN)) {
+ drmModeFreeProperty(prop);
continue;
+ }
snprintf(caps->props[i].name, TDM_NAME_LEN, "%s", prop->name);
caps->props[i].id = props->props[i];
caps->prop_count++;