chiark / gitweb /
coredumpctl: fix potential deref of null pointer
[elogind.git] / src / journal / coredumpctl.c
index 5a6c89707431b90180c1aab256db2c0c97328937..2158d7377194eedb6cd961eda53a88d25538dc91 100644 (file)
@@ -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 {