From 0346fda0b3ddc484c3a28d88a5c42b890feb3079 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Sat, 3 Aug 2013 14:27:07 +0300 Subject: most FREE_SET_NULL replaced with free FREE_SET_NULL makes extra assignment of NULL for pointers in stack or dynamic memory that is going to be freed. FREE_SET_NULL is useful for pointers that can be used in future. --- src/tools/autocomplete.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/tools') diff --git a/src/tools/autocomplete.c b/src/tools/autocomplete.c index 8426de85..5c70f874 100644 --- a/src/tools/autocomplete.c +++ b/src/tools/autocomplete.c @@ -24,6 +24,7 @@ #include #include +#include "common.h" #include "tools/autocomplete.h" #include "tools/parser.h" @@ -59,10 +60,7 @@ void autocomplete_reset(Autocomplete ac) { ac->last_found = NULL; - if (ac->search_str != NULL) { - free(ac->search_str); - ac->search_str = NULL; - } + FREE_SET_NULL(ac->search_str); } void -- cgit 1.4.1-2-gfad0