From 7b0a1933a00983b28951ae9987bbc6dcf4dc5fc8 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Thu, 30 Jun 2016 11:11:22 -0400 Subject: [PATCH] ecore-drm2: Don't leak return from _output_name_get function Coverity reports that we end up leaking the return from _output_name_get as the storage is never freed. Fixes Coverity CID1357161 @fix Signed-off-by: Chris Michael --- src/lib/ecore_drm2/ecore_drm2_outputs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index b8436ef..42e8e1a 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -519,6 +519,7 @@ _output_create(Ecore_Drm2_Device *dev, const drmModeRes *res, const drmModeConne { Ecore_Drm2_Output *output; int i = 0; + char *name = NULL; if (w) *w = 0; @@ -560,10 +561,12 @@ _output_create(Ecore_Drm2_Device *dev, const drmModeRes *res, const drmModeConne break; } - output->name = eina_stringshare_add(_output_name_get(conn)); + name = _output_name_get(conn); + output->name = eina_stringshare_add(name); output->make = eina_stringshare_add("unknown"); output->model = eina_stringshare_add("unknown"); output->serial = eina_stringshare_add("unknown"); + free(name); output->pipe = i; output->crtc_id = res->crtcs[i]; -- 2.7.4