Initialise the newly allocated memory, not the pointer to it.

This commit is contained in:
Andrew Wood
2024-12-22 11:29:21 +00:00
parent 1ef1d858f8
commit dc6cd1819d
+1 -1
View File
@@ -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);