diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-06-27 00:17:22 +0200 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-06-27 00:17:58 +0200 |
commit | d0c8806d4abf863baae1e3f796db674d57a67686 (patch) | |
tree | 9960d069d3d27aade04014663c97579396bda0e1 /src/journal/coredumpctl.c | |
parent | 7849c2acd479278d54851694762b967610912d02 (diff) |
coredumpctl: fix potential deref of null pointer
Diffstat (limited to 'src/journal/coredumpctl.c')
-rw-r--r-- | src/journal/coredumpctl.c | 6 |
1 files 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 { |