summaryrefslogtreecommitdiff
path: root/src/journal/coredumpctl.c
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-06-27 00:17:22 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-06-27 00:17:58 +0200
commitd0c8806d4abf863baae1e3f796db674d57a67686 (patch)
tree9960d069d3d27aade04014663c97579396bda0e1 /src/journal/coredumpctl.c
parent7849c2acd479278d54851694762b967610912d02 (diff)
coredumpctl: fix potential deref of null pointer
Diffstat (limited to 'src/journal/coredumpctl.c')
-rw-r--r--src/journal/coredumpctl.c6
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 {