From e2dc213609913484d9ea507419ba219ccb49e1de Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Wed, 29 May 2013 13:05:43 +0100 Subject: [PATCH] Backport: ee715e2 :: Fix possible memory leak reported by klockwork. Signed-off-by: Chris Michael Signed-off-by: Deon Thomas --- src/modules/conf_randr/e_smart_monitor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c index b1d7904fc..b2f264ea4 100644 --- a/src/modules/conf_randr/e_smart_monitor.c +++ b/src/modules/conf_randr/e_smart_monitor.c @@ -773,8 +773,10 @@ e_smart_monitor_changes_apply(Evas_Object *obj) /* get the outputs for this crtc */ outputs = ecore_x_randr_crtc_outputs_get(root, sd->crtc.id, &noutputs); - if ((!outputs) || (noutputs < 1)) + if (noutputs < 1) { + free(outputs); + if ((outputs = malloc(sizeof(Ecore_X_Randr_Output)))) { outputs[0] = sd->output;