diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-03-31 20:08:05 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-03-31 20:08:05 +0200 |
commit | b866264a18095d5302443ab0a95560d973ba4b10 (patch) | |
tree | d8adcb5b729b8d04f3f08d90ca6087729809ec38 /device.c | |
parent | 8e27452380193a5f81bfd08a59aab8b07008ba0b (diff) |
gcc: make a couple of gcc warnings go away
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -186,8 +186,10 @@ static int device_process_new_device(Manager *m, struct udev_device *dev, bool u if (names) { FOREACH_WORD(w, l, names, state) { - if (!(e = strndup(w, l))) + if (!(e = strndup(w, l))) { + r = -ENOMEM; goto fail; + } r = unit_add_name(u, e); free(e); @@ -199,8 +201,10 @@ static int device_process_new_device(Manager *m, struct udev_device *dev, bool u if (wants) { FOREACH_WORD(w, l, wants, state) { - if (!(e = strndup(w, l))) + if (!(e = strndup(w, l))) { + r = -ENOMEM; goto fail; + } r = unit_add_dependency_by_name(u, UNIT_WANTS, e); free(e); |