summaryrefslogtreecommitdiff
path: root/src/system-update-generator
diff options
context:
space:
mode:
Diffstat (limited to 'src/system-update-generator')
-rw-r--r--src/system-update-generator/system-update-generator.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/system-update-generator/system-update-generator.c b/src/system-update-generator/system-update-generator.c
index 6660192f5e..13b8a0c426 100644
--- a/src/system-update-generator/system-update-generator.c
+++ b/src/system-update-generator/system-update-generator.c
@@ -36,7 +36,7 @@ static const char *arg_dest = "/tmp";
static int generate_symlink(void) {
struct stat st;
- char *p;
+ char _cleanup_free_ *p = NULL;
if (lstat("/system-update", &st) < 0) {
if (errno == ENOENT)
@@ -51,13 +51,10 @@ static int generate_symlink(void) {
return log_oom();
if (symlink(SYSTEM_DATA_UNIT_PATH "/system-update.target", p) < 0) {
- free(p);
- log_error("Failed to create symlink: %m");
+ log_error("Failed to create symlink %s: %m", p);
return -errno;
}
- free(p);
-
return 0;
}