diff options
-rw-r--r-- | usr.sbin/syslogd/ringbuf.c | 10 | ||||
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 7 | ||||
-rw-r--r-- | usr.sbin/syslogd/syslogd.h | 1 |
3 files changed, 15 insertions, 3 deletions
diff --git a/usr.sbin/syslogd/ringbuf.c b/usr.sbin/syslogd/ringbuf.c index 43b4b1c83d7..5775d7bc606 100644 --- a/usr.sbin/syslogd/ringbuf.c +++ b/usr.sbin/syslogd/ringbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ringbuf.c,v 1.3 2004/06/25 19:10:54 djm Exp $ */ +/* $OpenBSD: ringbuf.c,v 1.4 2005/06/06 23:22:04 djm Exp $ */ /* * Copyright (c) 2004 Damien Miller @@ -51,6 +51,14 @@ ringbuf_init(size_t len) return (ret); } +/* Free a ring buffer */ +void +ringbuf_free(struct ringbuf *rb) +{ + free(rb->buf); + free(rb); +} + /* Clear a ring buffer */ void ringbuf_clear(struct ringbuf *rb) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index d3cd4f9ba96..a3070c03073 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.90 2005/04/21 16:15:50 djm Exp $ */ +/* $OpenBSD: syslogd.c,v 1.91 2005/06/06 23:22:04 djm Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -39,7 +39,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94"; #else -static const char rcsid[] = "$OpenBSD: syslogd.c,v 1.90 2005/04/21 16:15:50 djm Exp $"; +static const char rcsid[] = "$OpenBSD: syslogd.c,v 1.91 2005/06/06 23:22:04 djm Exp $"; #endif #endif /* not lint */ @@ -1147,6 +1147,9 @@ init(void) break; case F_FORW: break; + case F_MEMBUF: + ringbuf_free(f->f_un.f_mb.f_rb); + break; } next = f->f_next; if (f->f_program) diff --git a/usr.sbin/syslogd/syslogd.h b/usr.sbin/syslogd/syslogd.h index ca8f89d2bad..5e40e3eb82f 100644 --- a/usr.sbin/syslogd/syslogd.h +++ b/usr.sbin/syslogd/syslogd.h @@ -60,6 +60,7 @@ struct ringbuf { }; struct ringbuf *ringbuf_init(size_t); +void ringbuf_free(struct ringbuf *); void ringbuf_clear(struct ringbuf *); size_t ringbuf_used(struct ringbuf *); int ringbuf_append_line(struct ringbuf *, char *); |