summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/syslog.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/syslog.c b/misc/syslog.c
index fac969ae98..c0fcdf31a4 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -237,7 +237,7 @@ vsyslog(pri, fmt, ap)
v->iov_len = 1;
}
- __libc_cleanup_push (free, buf);
+ __libc_cleanup_push (free, buf == failbuf ? NULL : buf);
/* writev is a cancellation point. */
(void)__writev(STDERR_FILENO, iov, v - iov + 1);
@@ -305,7 +305,8 @@ vsyslog(pri, fmt, ap)
__libc_cleanup_pop (0);
__libc_lock_unlock (syslog_lock);
- free (buf);
+ if (buf != failbuf)
+ free (buf);
}
libc_hidden_def (vsyslog)