chiark / gitweb /
udevd: simplify rules execution loop
[elogind.git] / udev / lib / libudev-device.c
index bad6e94de58f462a0e6fac888442f3e2b68eca69..3f8ee1071cc96b4c1283d42a8dc3dd7d59ae919c 100644 (file)
@@ -266,7 +266,7 @@ struct udev_device *device_new(struct udev *udev)
  * path to the device, including the sys mount point.
  *
  * The initial refcount is 1, and needs to be decremented to
- * release the ressources of the udev device.
+ * release the resources of the udev device.
  *
  * Returns: a new udev device, or #NULL, if it does not exist
  **/
@@ -587,7 +587,7 @@ struct udev_device *udev_device_ref(struct udev_device *udev_device)
  * @udev_device: udev device
  *
  * Drop a reference of a udev device. If the refcount reaches zero,
- * the ressources of the device will be released.
+ * the resources of the device will be released.
  *
  **/
 void udev_device_unref(struct udev_device *udev_device)
@@ -1025,8 +1025,8 @@ static int update_envp_monitor_buf(struct udev_device *udev_device)
                return -ENOMEM;
 
        /* envp array, strings will point into monitor buffer */
-       free(udev_device->envp);
-       udev_device->envp = malloc(sizeof(char *) * ENVP_SIZE);
+       if (udev_device->envp == NULL)
+               udev_device->envp = malloc(sizeof(char *) * ENVP_SIZE);
        if (udev_device->envp == NULL)
                return -ENOMEM;