diff options
author | Dmitry Podgorny <pasis.ua@gmail.com> | 2013-08-03 14:27:07 +0300 |
---|---|---|
committer | Dmitry Podgorny <pasis.ua@gmail.com> | 2013-08-03 14:27:07 +0300 |
commit | 0346fda0b3ddc484c3a28d88a5c42b890feb3079 (patch) | |
tree | 4ffaa3d1ad7a20fe1c44e3509b060619e7d8ff2d /src/tools | |
parent | 6f498d1f69098742acc33d429c5e8dcee4edd86d (diff) | |
download | profani-tty-0346fda0b3ddc484c3a28d88a5c42b890feb3079.tar.gz |
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.
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/autocomplete.c | 6 |
1 files changed, 2 insertions, 4 deletions
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 <stdlib.h> #include <string.h> +#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 |