chiark / gitweb /
journald: check return value of strappend
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 30 Mar 2013 21:47:48 +0000 (17:47 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 31 Mar 2013 18:33:30 +0000 (14:33 -0400)
src/journal/journald-kmsg.c

index b819876..2f53632 100644 (file)
@@ -250,10 +250,12 @@ static void dev_kmsg_record(Server *s, char *p, size_t l) {
                                         break;
 
                                 g = udev_list_entry_get_name(ll);
-                                b = strappend("_UDEV_DEVLINK=", g);
                                 if (g) {
-                                        IOVEC_SET_STRING(iovec[n++], b);
-                                        z++;
+                                        b = strappend("_UDEV_DEVLINK=", g);
+                                        if (b) {
+                                                IOVEC_SET_STRING(iovec[n++], b);
+                                                z++;
+                                        }
                                 }
 
                                 j++;