aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rcynic/rcynic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rcynic/rcynic.c b/rcynic/rcynic.c
index 5f69d228..2fb62090 100644
--- a/rcynic/rcynic.c
+++ b/rcynic/rcynic.c
@@ -2797,6 +2797,7 @@ int main(int argc, char *argv[])
logmsg(&rc, log_telemetry, "Lock %s held by another process", lockfile);
else
logmsg(&rc, log_sys_err, "Problem locking %s: %s", lockfile, strerror(errno));
+ lockfd = -1;
goto done;
}
@@ -3029,6 +3030,8 @@ int main(int argc, char *argv[])
free(rc.unauthenticated);
if (rc.rsync_program)
free(rc.rsync_program);
+ if (lockfile && lockfd >= 0)
+ unlink(lockfile);
if (lockfile)
free(lockfile);
if (xmlfile)