chiark / gitweb /
nspawn: log out of memory errors
authorDjalal Harouni <tixxdz@opendz.org>
Tue, 5 Nov 2013 14:26:37 +0000 (15:26 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 Nov 2013 17:06:44 +0000 (18:06 +0100)
src/nspawn/nspawn.c

index 1477456..80903a7 100644 (file)
@@ -224,6 +224,9 @@ static int parse_argv(int argc, char *argv[]) {
 
                 case 'S':
                         arg_slice = strdup(optarg);
+                        if (!arg_slice)
+                                return log_oom();
+
                         break;
 
                 case 'M':
@@ -315,11 +318,11 @@ static int parse_argv(int argc, char *argv[]) {
 
                         r = strv_extend(x, a);
                         if (r < 0)
-                                return r;
+                                return log_oom();
 
                         r = strv_extend(x, b);
                         if (r < 0)
-                                return r;
+                                return log_oom();
 
                         break;
                 }