diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-10-16 18:28:30 -0400 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-07-05 08:50:55 +0200 |
commit | 2aebec83237867717ad3ba0096a82670d82d911a (patch) | |
tree | d1f39278420f6f9d7d51a0e6a9d1dce1120ce9dc /src/basic | |
parent | 9f751b60fbe45dfc9fb17c5ec6452b68e9e0a89a (diff) |
tree-wide: use mfree more
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/prioq.c | 4 | ||||
-rw-r--r-- | src/basic/string-util.c | 6 | ||||
-rw-r--r-- | src/basic/strv.c | 9 |
3 files changed, 6 insertions, 13 deletions
diff --git a/src/basic/prioq.c b/src/basic/prioq.c index d2ec516d2..4570b8e4b 100644 --- a/src/basic/prioq.c +++ b/src/basic/prioq.c @@ -62,9 +62,7 @@ Prioq* prioq_free(Prioq *q) { return NULL; free(q->items); - free(q); - - return NULL; + return mfree(q); } int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func) { diff --git a/src/basic/string-util.c b/src/basic/string-util.c index dc7de5dab..6b06e643c 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -610,8 +610,7 @@ char *strreplace(const char *text, const char *old_string, const char *new_strin return r; oom: - free(r); - return NULL; + return mfree(r); } char *strip_tab_ansi(char **ibuf, size_t *_isz) { @@ -682,8 +681,7 @@ char *strip_tab_ansi(char **ibuf, size_t *_isz) { if (ferror(f)) { fclose(f); - free(obuf); - return NULL; + return mfree(obuf); } fclose(f); diff --git a/src/basic/strv.c b/src/basic/strv.c index baaa72e67..c98e956fd 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -87,8 +87,7 @@ void strv_clear(char **l) { char **strv_free(char **l) { strv_clear(l); - free(l); - return NULL; + return mfree(l); } char **strv_free_erase(char **l) { @@ -431,8 +430,7 @@ char *strv_join_quoted(char **l) { return buf; oom: - free(buf); - return NULL; + return mfree(buf); } #endif // 0 @@ -882,8 +880,7 @@ char ***strv_free_free(char ***l) { for (i = l; *i; i++) strv_free(*i); - free(l); - return NULL; + return mfree(l); } char **strv_skip(char **l, size_t n) { |