From: Tim Duesterhus Date: Tue, 28 Apr 2026 19:59:14 +0000 (+0200) Subject: CLEANUP: Reapply ha_free.cocci (2) X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=thirdparty%2Fhaproxy.git CLEANUP: Reapply ha_free.cocci (2) This reapplies ha_free.cocci across the whole src/ tree. --- diff --git a/src/haterm_init.c b/src/haterm_init.c index a56ac3eb3..f43ca5630 100644 --- a/src/haterm_init.c +++ b/src/haterm_init.c @@ -80,8 +80,7 @@ static struct hbuf *hbuf_alloc(struct hbuf *h) static inline void free_hbuf(struct hbuf *h) { - free(h->area); - h->area = NULL; + ha_free(&h->area); } __attribute__ ((format(printf, 2, 3))) diff --git a/src/tools.c b/src/tools.c index 2687c2cdc..3adc7cf3f 100644 --- a/src/tools.c +++ b/src/tools.c @@ -7565,8 +7565,7 @@ int backup_env(void) free(*tmp); tmp++; } - free(init_env); - init_env = NULL; + ha_free(&init_env); return -1; } tmp++; @@ -7761,8 +7760,7 @@ void ha_freearray(char ***array) char **r = *array; for (i = 0; r && r[i]; i++) { - free(r[i]); - r[i] = NULL; + ha_free(&r[i]); } *array = NULL; }