aboutsummaryrefslogtreecommitdiffstats
path: root/caputils/capture-pcap-util-unix.c
diff options
context:
space:
mode:
authorJoerg Mayer <jmayer@loplof.de>2017-02-22 19:04:07 +0100
committerJörg Mayer <jmayer@loplof.de>2017-02-22 21:53:36 +0000
commit785a0d8e75560a9a8733f667751ea403f6400d53 (patch)
tree2361150fcc672f4979ce12e0add108558c15a476 /caputils/capture-pcap-util-unix.c
parent936a4c1eb95384bca8563d2b210d243167f4fe20 (diff)
g_malloc -> g_malloc0 where not all struct elements are initialized or
when combined with memset. Change-Id: I5148a65bee6d4d00c140113ffb1e228adefae93f Reviewed-on: https://code.wireshark.org/review/20251 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
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) {