chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
804ab68
)
libudev: device - free values before updating them
author
Kay Sievers
<kay.sievers@vrfy.org>
Wed, 8 Jul 2009 00:02:40 +0000
(
02:02
+0200)
committer
Kay Sievers
<kay.sievers@vrfy.org>
Wed, 8 Jul 2009 00:02:40 +0000
(
02:02
+0200)
libudev/libudev-device.c
patch
|
blob
|
history
diff --git
a/libudev/libudev-device.c
b/libudev/libudev-device.c
index cbbddaeff044c6df548bdb1c42cf61f113a69126..9d1e546c83dd304c84484cc21585a27726b092bb 100644
(file)
--- a/
libudev/libudev-device.c
+++ b/
libudev/libudev-device.c
@@
-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,6
+1297,7
@@
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;