]> git.ipfire.org Git - thirdparty/git.git/commitdiff
reftable: fix calls to free(3P)
authorPatrick Steinhardt <ps@pks.im>
Wed, 2 Oct 2024 10:56:33 +0000 (12:56 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Oct 2024 14:53:56 +0000 (07:53 -0700)
There are a small set of calls to free(3P) in the reftable library. As
the reftable allocators are pluggable we should rather call the reftable
specific function, which is `reftable_free()`.

Convert the code accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/stack.c
t/unit-tests/t-reftable-readwrite.c

index 7df28ab34381c085c5bff0a233388363fce29a4c..b2babe8e3dc5865c7e3f7fb8b888f3111e4f2575 100644 (file)
@@ -1421,7 +1421,7 @@ static int stack_compact_range(struct reftable_stack *st,
                struct lock_file *table_lock = &table_locks[i];
                char *table_path = get_locked_file_path(table_lock);
                unlink(table_path);
-               free(table_path);
+               reftable_free(table_path);
        }
 
 done:
index bfa069caff782a0edb3bf99659ca65fc0d80881b..27ce84445e821e0d27affe8b5896a54d7a3f95c8 100644 (file)
@@ -76,8 +76,8 @@ static void write_table(char ***names, struct strbuf *buf, int N,
 
        t_reftable_write_to_buf(buf, refs, N, logs, N, &opts);
 
-       free(refs);
-       free(logs);
+       reftable_free(refs);
+       reftable_free(logs);
 }
 
 static void t_log_buffer_size(void)