From d0c8806d4abf863baae1e3f796db674d57a67686 Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Fri, 27 Jun 2014 00:17:22 +0200 Subject: coredumpctl: fix potential deref of null pointer --- src/journal/coredumpctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c index 5a6c897074..2158d73771 100644 --- a/src/journal/coredumpctl.c +++ b/src/journal/coredumpctl.c @@ -601,8 +601,10 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) { } if (filename && !endswith(filename, ".xz")) { - *path = filename; - filename = NULL; + if (path) { + *path = filename; + filename = NULL; + } return 0; } else { -- cgit v1.2.3-54-g00ecf