chiark / gitweb /
udev: net_id - use constants rather than magic numbers
[elogind.git] / src / udev / udev-ctrl.c
index a65603b3cf3b355293300afb128b3f36e01bc437..1e91ec20a1f8930460a91016daa22d8be8bcbada 100644 (file)
@@ -75,7 +75,7 @@ struct udev_ctrl *udev_ctrl_new_from_fd(struct udev *udev, int fd)
         struct udev_ctrl *uctrl;
         const int on = 1;
 
-        uctrl = calloc(1, sizeof(struct udev_ctrl));
+        uctrl = new0(struct udev_ctrl, 1);
         if (uctrl == NULL)
                 return NULL;
         uctrl->refcount = 1;
@@ -180,7 +180,7 @@ int udev_ctrl_get_fd(struct udev_ctrl *uctrl)
 struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uctrl)
 {
         struct udev_ctrl_connection *conn;
-        struct ucred ucred;
+        struct ucred ucred = {};
         const int on = 1;
         int r;