X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=libudev%2Flibudev-device.c;h=9d1e546c83dd304c84484cc21585a27726b092bb;hp=951f78aa5c7a7f9d3838bae78bab911d0eb55e67;hb=59d93adb29fae25220955d44a5cd25f0d99e3528;hpb=b25a94549ce37cd7654f6f44b66944375919db58 diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c index 951f78aa5..9d1e546c8 100644 --- a/libudev/libudev-device.c +++ b/libudev/libudev-device.c @@ -961,7 +961,7 @@ unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device) * @udev_device: udev device * @sysattr: attribute name * - * The retrieved value is cached in the device. Repeated reads will return the same + * The retrieved value is cached in the device. Repeated calls will return the same * value and not open the attribute again. * * Returns: the content of a sys attribute file, or #NULL if there is no sys attribute value. @@ -1282,6 +1282,7 @@ const char *udev_device_get_devpath_old(struct udev_device *udev_device) int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old) { + free(udev_device->devpath_old); udev_device->devpath_old = strdup(devpath_old); if (udev_device->devpath_old == NULL) return -ENOMEM; @@ -1296,9 +1297,11 @@ const char *udev_device_get_knodename(struct udev_device *udev_device) int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename) { + free(udev_device->knodename); udev_device->knodename = strdup(knodename); if (udev_device->knodename == NULL) return -ENOMEM; + udev_device_add_property(udev_device, "DEVNAME", udev_device->knodename); return 0; }