From b4f277a4a62d34e5ac4f5539d474d5c6f79af210 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Thu, 27 Jun 2013 10:57:22 +0100 Subject: [PATCH] When we free outputs, set the variable to NULL. Signed-off-by: Chris Michael --- src/modules/conf_randr/e_smart_monitor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c index 9cd7d2df3..d1fbc1547 100644 --- a/src/modules/conf_randr/e_smart_monitor.c +++ b/src/modules/conf_randr/e_smart_monitor.c @@ -811,7 +811,8 @@ e_smart_monitor_changes_apply(Evas_Object *obj) { mode = 0; noutputs = 0; - free(outputs); + if (outputs) free(outputs); + outputs = NULL; } cx = sd->current.x; @@ -846,7 +847,8 @@ e_smart_monitor_changes_apply(Evas_Object *obj) } /* free any allocated memory from ecore_x_randr */ - free(outputs); + if (outputs) free(outputs); + outputs = NULL; /* update crtc values to match current values */ sd->crtc.x = cx;