diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-05-20 20:39:38 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-05-20 20:39:38 +0000 |
commit | 88917b0f143e2eac468aea14338b4d9eddba389d (patch) | |
tree | 790fd49f0632b93a7ad9cd02974bff82efa60b25 /libc/misc/regex | |
parent | 43eb269ab1d216074e18dadc74c9671398dfe938 (diff) |
replace "if (p) free(p)" by just "free(p)" - free(NULL) is safe.
Diffstat (limited to 'libc/misc/regex')
-rw-r--r-- | libc/misc/regex/regex_old.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c index 57b97ae68..7a9c4d7e0 100644 --- a/libc/misc/regex/regex_old.c +++ b/libc/misc/regex/regex_old.c @@ -5132,7 +5132,7 @@ strong_alias(__re_search_2, re_search_2) #ifdef MATCH_MAY_ALLOCATE # define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL #else -# define FREE_VAR(var) if (var) free (var); var = NULL +# define FREE_VAR(var) free (var); var = NULL #endif #ifdef WCHAR @@ -8313,20 +8313,17 @@ void regfree (preg) regex_t *preg; { - if (preg->buffer != NULL) - free (preg->buffer); + free (preg->buffer); preg->buffer = NULL; preg->allocated = 0; preg->used = 0; - if (preg->fastmap != NULL) - free (preg->fastmap); + free (preg->fastmap); preg->fastmap = NULL; preg->fastmap_accurate = 0; - if (preg->translate != NULL) - free (preg->translate); + free (preg->translate); preg->translate = NULL; } #if defined _LIBC || defined __UCLIBC__ |