diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-04-08 19:42:29 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-08 20:35:25 +0200 |
commit | 903a0b07e003c1ad976dc30e98b69a70778007ad (patch) | |
tree | 3029d911fbd131afbec22fede8d9abb7a5370600 /src | |
parent | f5b7a3fb53bc37e4d2cd042094a4be0d6bb1348a (diff) |
analyze: fix OOM handling + fix memory leak
Diffstat (limited to 'src')
-rw-r--r-- | src/analyze/systemd-analyze.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c index 55f7c42102..ec579282e7 100644 --- a/src/analyze/systemd-analyze.c +++ b/src/analyze/systemd-analyze.c @@ -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: |