chiark / gitweb /
coredumpctl: fix potential deref of null pointer
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Thu, 26 Jun 2014 22:17:22 +0000 (00:17 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Thu, 26 Jun 2014 22:17:58 +0000 (00:17 +0200)
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 {