From 1c7027cd48ca7fe092641591c197be8ff6933e79 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 21 Apr 2021 15:38:30 +0800 Subject: [PATCH] Hash the pointer value too if it point to the file name since table_find always compare the pointer value not the string it point to Signed-off-by: Xiang Xiao Change-Id: I71e69637d1e8a04bd2a17c76371d14df681ef84f --- dmalloc_tab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmalloc_tab.c b/dmalloc_tab.c index a40b3864..29c6091b 100644 --- a/dmalloc_tab.c +++ b/dmalloc_tab.c @@ -169,7 +169,7 @@ static unsigned int which_bucket(const int entry_n, const char *file, } } else { - bucket = hash((unsigned char *)file, strlen(file), 0); + bucket = hash((unsigned char *)&file, sizeof(char *), 0); bucket = hash((unsigned char *)&line, sizeof(line), bucket); }