Skip to content

Commit 588e4fb

Browse files
avargitster
authored andcommitted
grep/pcre2: prepare to add debugging to pcre2_malloc()
Change pcre2_malloc() in a way that'll make it easier for a debugging fprintf() to spew out the allocated pointer. This doesn't introduce any functional change, it just makes a subsequent commit's diff easier to read. Changes code added in 513f2b0 (grep: make PCRE2 aware of custom allocator, 2019-10-16). Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 47eebd2 commit 588e4fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

grep.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ static pcre2_general_context *pcre2_global_context;
4545

4646
static void *pcre2_malloc(PCRE2_SIZE size, MAYBE_UNUSED void *memory_data)
4747
{
48-
return malloc(size);
48+
void *pointer = malloc(size);
49+
return pointer;
4950
}
5051

5152
static void pcre2_free(void *pointer, MAYBE_UNUSED void *memory_data)

0 commit comments

Comments
 (0)