tree-wide: return NULL from freeing functions

I started working on this because I wanted to change how
DEFINE_TRIVIAL_CLEANUP_FUNC is defined. Even independently of that change, it's
nice to make make things more consistent and predictable.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-02-16 17:15:10 +01:00
parent 5d160a2304
commit 75db809ae5
52 changed files with 154 additions and 165 deletions
+4 -4
View File
@@ -26,7 +26,7 @@
* ...
*/
struct strbuf *strbuf_new(void) {
struct strbuf* strbuf_new(void) {
struct strbuf *str;
str = new(struct strbuf, 1);
@@ -65,13 +65,13 @@ void strbuf_complete(struct strbuf *str) {
}
/* clean up everything */
void strbuf_cleanup(struct strbuf *str) {
struct strbuf* strbuf_cleanup(struct strbuf *str) {
if (!str)
return;
return NULL;
strbuf_complete(str);
free(str->buf);
free(str);
return mfree(str);
}
static int strbuf_children_cmp(const struct strbuf_child_entry *n1,