chiark / gitweb /
analyze: fix OOM handling + fix memory leak
authorLennart Poettering <lennart@poettering.net>
Mon, 8 Apr 2013 17:42:29 +0000 (19:42 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 8 Apr 2013 18:35:25 +0000 (20:35 +0200)
src/analyze/systemd-analyze.c

index 55f7c42..ec57928 100644 (file)
@@ -851,11 +851,15 @@ static int parse_argv(int argc, char *argv[])
                         break;
 
                 case ARG_DOT_FROM_PATTERN:
-                        arg_dot_from_patterns = strv_append(arg_dot_from_patterns, optarg);
+                        if (strv_extend(&arg_dot_from_patterns, optarg) < 0)
+                                return log_oom();
+
                         break;
 
                 case ARG_DOT_TO_PATTERN:
-                        arg_dot_to_patterns = strv_append(arg_dot_to_patterns, optarg);
+                        if (strv_extend(&arg_dot_to_patterns, optarg) < 0)
+                                return log_oom();
+
                         break;
 
                 case -1: