summaryrefslogtreecommitdiff
path: root/caputils/capture-pcap-util-unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'caputils/capture-pcap-util-unix.c')
-rw-r--r--caputils/capture-pcap-util-unix.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/caputils/capture-pcap-util-unix.c b/caputils/capture-pcap-util-unix.c
index a11eefa29c..7dd49a1b30 100644
--- a/caputils/capture-pcap-util-unix.c
+++ b/caputils/capture-pcap-util-unix.c
@@ -159,10 +159,9 @@ get_interface_list(int *err, char **err_str)
lastlen = 0;
len = 100 * sizeof(struct ifreq);
for ( ; ; ) {
- buf = (char *)g_malloc(len);
+ buf = (char *)g_malloc0(len);
ifc.ifc_len = len;
ifc.ifc_buf = buf;
- memset (buf, 0, len);
if (ioctl(sock, SIOCGIFCONF, &ifc) < 0) {
if (errno != EINVAL || lastlen != 0) {
if (err_str != NULL) {