From dc6cd1819d4ff298e8193d1c4a01f341d70e473c Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 22 Dec 2024 11:29:21 +0000 Subject: [PATCH] Initialise the newly allocated memory, not the pointer to it. --- src/pv/watchpid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pv/watchpid.c b/src/pv/watchpid.c index beb0e08..32f672a 100644 --- a/src/pv/watchpid.c +++ b/src/pv/watchpid.c @@ -308,7 +308,7 @@ static int pidfds(pvstate_t state, unsigned int pid, struct proc_fdinfo **fds, i pv_error(state, "%s: alloc failed: %s", _("pid"), strerror(errno)); return -1; } - memset(fds, 0, size_needed); + memset(*fds, 0, size_needed); proc_pidinfo(pid, PROC_PIDLISTFDS, 0, *fds, size_needed);