From 501b54278cf3965d9d38dba81870c4ea371d20a3 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 7 Nov 2015 00:23:16 +0000 Subject: s6-rc-init bugfix: don't use satmp.s after cleanup() (thanks Eric Le Bihan) --- src/s6-rc/s6-rc-init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/s6-rc/s6-rc-init.c b/src/s6-rc/s6-rc-init.c index 2043c99..e7ef023 100644 --- a/src/s6-rc/s6-rc-init.c +++ b/src/s6-rc/s6-rc-init.c @@ -90,8 +90,10 @@ int main (int argc, char const *const *argv) if (mkdir(satmp.s, 0755) < 0) strerr_diefu2sys(111, "mkdir ", satmp.s) ; if (!s6rc_lock(satmp.s, 2, &fdlock, 0, 0, 0)) { + char tmp[satmp.len] ; + byte_copy(tmp, satmp.len, satmp.s) ; cleanup() ; - strerr_diefu2sys(111, "take lock on ", satmp.s) ; + strerr_diefu2sys(111, "take lock on ", tmp) ; } byte_copy(lfn, llen, satmp.s) ; lfn[llen] = 0 ; -- cgit v1.2.3