summaryrefslogtreecommitdiff
path: root/src/journal/coredumpctl.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-07-31 19:56:38 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-07-31 19:56:38 +0200
commit97b11eedff9d2e17101ad453caf9e48b73246719 (patch)
treeadd86c36a039f2cbeb8232908c7a0cb3ca784ea5 /src/journal/coredumpctl.c
parentb2a0ac5e5b29c73ca7c0da23369a4769d5a91ddd (diff)
tree-wide: introduce mfree()
Pretty trivial helper which wraps free() but returns NULL, so we can simplify this: free(foobar); foobar = NULL; to this: foobar = mfree(foobar);
Diffstat (limited to 'src/journal/coredumpctl.c')
-rw-r--r--src/journal/coredumpctl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index fc49b2e174..098f62af50 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -587,8 +587,7 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) {
if (filename && access(filename, R_OK) < 0) {
log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING,
"File %s is not readable: %m", filename);
- free(filename);
- filename = NULL;
+ filename = mfree(filename);
}
if (filename && !endswith(filename, ".xz") && !endswith(filename, ".lz4")) {