summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-12-17 03:11:52 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-12-17 03:11:52 -0500
commitb849891b5dde5ee14ab8b7b7db74e65a4a38d993 (patch)
tree29bb0e6fda9b4b170041913de495da057bbe3621 /src/libudev
parent004efebf9cc559ea131bb9460ee0ee198e2d5da7 (diff)
parent881228ff72434a0e3401a16bd87f179ef0ab1619 (diff)
Merge branch 'notsystemd/postmove' into notsystemd/master
# Conflicts: # src/grp-journal/libjournal-core/.gitignore # src/grp-system/libcore/include/core/mount.h
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/src/libudev-device.c2
-rw-r--r--src/libudev/src/libudev-list.c14
-rw-r--r--src/libudev/src/libudev-monitor.c3
3 files changed, 8 insertions, 11 deletions
diff --git a/src/libudev/src/libudev-device.c b/src/libudev/src/libudev-device.c
index 0944c27d39..d6e2c5fa6e 100644
--- a/src/libudev/src/libudev-device.c
+++ b/src/libudev/src/libudev-device.c
@@ -497,7 +497,7 @@ _public_ struct udev_device *udev_device_get_parent_with_subsystem_devtype(struc
return NULL;
}
- /* then walk the chain of udev_device parents until the correspanding
+ /* then walk the chain of udev_device parents until the corresponding
one is found */
while ((udev_device = udev_device_get_parent(udev_device))) {
if (udev_device->device == parent)
diff --git a/src/libudev/src/libudev-list.c b/src/libudev/src/libudev-list.c
index f4eb38af1e..3700ba2697 100644
--- a/src/libudev/src/libudev-list.c
+++ b/src/libudev/src/libudev-list.c
@@ -167,17 +167,16 @@ struct udev_list_entry *udev_list_entry_add(struct udev_list *list, const char *
entry = new0(struct udev_list_entry, 1);
if (entry == NULL)
return NULL;
+
entry->name = strdup(name);
- if (entry->name == NULL) {
- free(entry);
- return NULL;
- }
+ if (entry->name == NULL)
+ return mfree(entry);
+
if (value != NULL) {
entry->value = strdup(value);
if (entry->value == NULL) {
free(entry->name);
- free(entry);
- return NULL;
+ return mfree(entry);
}
}
@@ -194,8 +193,7 @@ struct udev_list_entry *udev_list_entry_add(struct udev_list *list, const char *
if (entries == NULL) {
free(entry->name);
free(entry->value);
- free(entry);
- return NULL;
+ return mfree(entry);
}
list->entries = entries;
list->entries_max += add;
diff --git a/src/libudev/src/libudev-monitor.c b/src/libudev/src/libudev-monitor.c
index 71703e927e..db433d6243 100644
--- a/src/libudev/src/libudev-monitor.c
+++ b/src/libudev/src/libudev-monitor.c
@@ -209,8 +209,7 @@ struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *udev, const c
udev_monitor->sock = socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_KOBJECT_UEVENT);
if (udev_monitor->sock < 0) {
log_debug_errno(errno, "error getting socket: %m");
- free(udev_monitor);
- return NULL;
+ return mfree(udev_monitor);
}
} else {
udev_monitor->bound = true;