Skip to content

Commit daa59e9

Browse files
pks-tgitster
authored andcommitted
reftable: fix calls to free(3P)
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 12b9078 commit daa59e9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

reftable/stack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ static int stack_compact_range(struct reftable_stack *st,
14211421
struct lock_file *table_lock = &table_locks[i];
14221422
char *table_path = get_locked_file_path(table_lock);
14231423
unlink(table_path);
1424-
free(table_path);
1424+
reftable_free(table_path);
14251425
}
14261426

14271427
done:

t/unit-tests/t-reftable-readwrite.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ static void write_table(char ***names, struct strbuf *buf, int N,
7676

7777
t_reftable_write_to_buf(buf, refs, N, logs, N, &opts);
7878

79-
free(refs);
80-
free(logs);
79+
reftable_free(refs);
80+
reftable_free(logs);
8181
}
8282

8383
static void t_log_buffer_size(void)

0 commit comments

Comments
 (0)