]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: Reapply ha_free.cocci (2) master
authorTim Duesterhus <tim@bastelstu.be>
Tue, 28 Apr 2026 19:59:14 +0000 (21:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 29 Apr 2026 02:39:12 +0000 (04:39 +0200)
This reapplies ha_free.cocci across the whole src/ tree.

src/haterm_init.c
src/tools.c

index a56ac3eb3238672d818f9ed07d4fe9a1450bfc4f..f43ca5630f2f85615c19add50531106ce3deb278 100644 (file)
@@ -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)))
index 2687c2cdc4d22c2c2b2c121b29e1525728515f0e..3adc7cf3f315940981b02630da8e9fab830459e4 100644 (file)
@@ -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;
 }