summaryrefslogtreecommitdiffstats
path: root/libdwfl
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2021-09-06 08:00:00 +0000
committerDmitry V. Levin <ldv@altlinux.org>2021-09-09 08:01:00 +0000
commite094270980f1ca8af86a64cee0dbb6f1df670619 (patch)
tree1471f9586bb9e3d7f5448001353d47e94145a4ae /libdwfl
parentsrc: add -Wno-error=stack-usage= to AM_LDFLAGS (diff)
downloadelfutils-e094270980f1ca8af86a64cee0dbb6f1df670619.tar.gz
elfutils-e094270980f1ca8af86a64cee0dbb6f1df670619.tar.bz2
elfutils-e094270980f1ca8af86a64cee0dbb6f1df670619.tar.xz
Remove redundant casts of memory allocating functions returning void *
Return values of functions returning "void *", e.g. calloc, malloc, realloc, xcalloc, xmalloc, and xrealloc, do not need explicit casts. Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Diffstat (limited to 'libdwfl')
-rw-r--r--libdwfl/ChangeLog5
-rw-r--r--libdwfl/linux-pid-attach.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 1fce7af2..d35674c7 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
12021-09-06 Dmitry V. Levin <ldv@altlinux.org>
2
3 * linux-pid-attach.c (read_cached_memory): Remove cast of malloc
4 return value.
5
12021-06-09 Omar Sandoval <osandov@fb.com> 62021-06-09 Omar Sandoval <osandov@fb.com>
2 7
3 * link_map.c (read_addrs): Fix potential NULL pointer dereference. 8 * link_map.c (read_addrs): Fix potential NULL pointer dereference.
diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c
index cd534825..09cba07b 100644
--- a/libdwfl/linux-pid-attach.c
+++ b/libdwfl/linux-pid-attach.c
@@ -135,7 +135,7 @@ read_cached_memory (struct __libdwfl_pid_arg *pid_arg,
135 if (mem_cache == NULL) 135 if (mem_cache == NULL)
136 { 136 {
137 size_t mem_cache_size = sizeof (struct __libdwfl_remote_mem_cache); 137 size_t mem_cache_size = sizeof (struct __libdwfl_remote_mem_cache);
138 mem_cache = (struct __libdwfl_remote_mem_cache *) malloc (mem_cache_size); 138 mem_cache = malloc (mem_cache_size);
139 if (mem_cache == NULL) 139 if (mem_cache == NULL)
140 return false; 140 return false;
141 141