From c8ea6cea1f7caff97aea6ce87eac3b2a0ae3e1f2 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 25 Apr 2021 04:33:14 +0800 Subject: [PATCH] Shouldn't assign file_p to the return address in _dmalloc_chunk_read_info Signed-off-by: Xiang Xiao Change-Id: I48032b4985ec7331127cd2035c95bdf24bb54cb9 --- chunk.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/chunk.c b/chunk.c index 9f3d52f8..86b9e22a 100644 --- a/chunk.c +++ b/chunk.c @@ -1892,18 +1892,14 @@ int _dmalloc_chunk_read_info(const void *user_pnt, const char *where, /* write info back to user space */ SET_POINTER(user_size_p, slot_p->sa_user_size); SET_POINTER(alloc_size_p, slot_p->sa_total_size); - if (slot_p->sa_file == DMALLOC_DEFAULT_FILE) { - SET_POINTER(file_p, NULL); - } - else { - SET_POINTER(file_p, (char *)slot_p->sa_file); - } SET_POINTER(line_p, slot_p->sa_line); /* if the line is blank then the file will be 0 or the return address */ if (slot_p->sa_line == DMALLOC_DEFAULT_LINE) { + SET_POINTER(file_p, NULL); SET_POINTER(ret_attr_p, (char *)slot_p->sa_file); } else { + SET_POINTER(file_p, (char *)slot_p->sa_file); SET_POINTER(ret_attr_p, NULL); } #if LOG_PNT_SEEN_COUNT