chiark / gitweb /
networkctl: two OOM fixes
authorLennart Poettering <lennart@poettering.net>
Fri, 15 Aug 2014 13:34:56 +0000 (15:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 15 Aug 2014 13:34:56 +0000 (15:34 +0200)
src/network/networkctl.c

index bf95aa2..8f2c1b3 100644 (file)
@@ -371,7 +371,11 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
                 char *wildcard;
 
                 wildcard = strdup("*");
-                strv_push(&domains, wildcard);
+                if (!wildcard)
+                        return log_oom();
+
+                if (strv_consume(&domains, wildcard) < 0)
+                        return log_oom();
         }
 
         sprintf(devid, "n%i", ifindex);