Free allocated memory if commit failed
[platform/adaptation/nexell/libtdm-nexell.git] / src / libhal-backend-tdm-nexell / tdm_nexell_display.c
index 830ecf4..63a827a 100644 (file)
@@ -1550,6 +1550,7 @@ _nexell_output_atomic_commit(hal_tdm_output *output, int sync, void *user_data)
 
        if (drmModeAtomicCommit(output_data->display_data->drm_fd, request, flags, event_data) < 0) {
                TDM_BACKEND_ERR("drmModeAtomicCommit failed.");
+               free(event_data);
                drmModeAtomicFree(request);
                return HAL_TDM_ERROR_OPERATION_FAILED;
        }
@@ -2202,4 +2203,4 @@ nexell_output_data_get_layer_data(tdm_nexell_output *output_data, int layer_zpos
        }
 
        return NULL;
-}
\ No newline at end of file
+}