summaryrefslogtreecommitdiff
path: root/udev/lib/libudev-monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'udev/lib/libudev-monitor.c')
-rw-r--r--udev/lib/libudev-monitor.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/udev/lib/libudev-monitor.c b/udev/lib/libudev-monitor.c
index 6c6f4aa7e0..7f7f8460c2 100644
--- a/udev/lib/libudev-monitor.c
+++ b/udev/lib/libudev-monitor.c
@@ -67,10 +67,9 @@ struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char
return NULL;
if (socket_path == NULL)
return NULL;
- udev_monitor = malloc(sizeof(struct udev_monitor));
+ udev_monitor = calloc(1, sizeof(struct udev_monitor));
if (udev_monitor == NULL)
return NULL;
- memset(udev_monitor, 0x00, sizeof(struct udev_monitor));
udev_monitor->refcount = 1;
udev_monitor->udev = udev;
@@ -105,10 +104,9 @@ struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev)
if (udev == NULL)
return NULL;
- udev_monitor = malloc(sizeof(struct udev_monitor));
+ udev_monitor = calloc(1, sizeof(struct udev_monitor));
if (udev_monitor == NULL)
return NULL;
- memset(udev_monitor, 0x00, sizeof(struct udev_monitor));
udev_monitor->refcount = 1;
udev_monitor->udev = udev;