]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: do not leak memory (#8352)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 5 Mar 2018 07:39:52 +0000 (16:39 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 5 Mar 2018 07:39:52 +0000 (08:39 +0100)
Fixes #8351.

src/coredump/coredumpctl.c

index 6b697c37fc5008eff71df1a230bbdccaa5af1f1b..a4cc9c1db3d58648f795c3e389dcc8590793a4e3 100644 (file)
@@ -94,10 +94,7 @@ static int add_match(sd_journal *j, const char *match) {
         else
                 prefix = "COREDUMP_COMM=";
 
-        pattern = strjoin(prefix, match);
-        if (!pattern)
-                return log_oom();
-
+        pattern = strjoina(prefix, match);
         log_debug("Adding match: %s", pattern);
         r = sd_journal_add_match(j, pattern, 0);
         if (r < 0)