fix memory leak 13/152713/1
authorBoram Park <boram1288.park@samsung.com>
Wed, 27 Sep 2017 01:11:08 +0000 (10:11 +0900)
committerBoram Park <boram1288.park@samsung.com>
Wed, 27 Sep 2017 01:11:08 +0000 (10:11 +0900)
Change-Id: I4c62389755ad2ba15deea3d540dc48dfddd4ee01

src/tdm_nexell_display.c

index 2cdf77bf85231a319c2316e8173c14e7c3ba5b73..8acc4a8a60c01d96bc3f137b212a948f276f7f60 100644 (file)
@@ -852,6 +852,7 @@ tdm_nexell_display_create_output_list(tdm_nexell_data *nexell_data)
        if (crtc_id == 0) {
                TDM_ERR("no possible crtc");
                drmModeFreeConnector(connector);
+               drmModeFreeEncoder(encoder);
                ret = TDM_ERROR_OPERATION_FAILED;
                goto failed_create;
        }
@@ -1534,10 +1535,14 @@ nexell_layer_get_capability(tdm_layer *layer, tdm_caps_layer *caps)
                drmModePropertyPtr prop = drmModeGetProperty(nexell_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++;