diff options
author | 2015-07-09 16:01:48 +0000 | |
---|---|---|
committer | 2015-07-09 16:01:48 +0000 | |
commit | 319825b05071d393b1d554f38e378dbc4900174c (patch) | |
tree | b24dab3988c5e2d261498a4a53d02458a6d6ec21 | |
parent | Move the softc definition to uvideo.c so that userland can include (diff) | |
download | wireguard-openbsd-319825b05071d393b1d554f38e378dbc4900174c.tar.xz wireguard-openbsd-319825b05071d393b1d554f38e378dbc4900174c.zip |
Set f_hostname to NULL after free() to avoid a double free when
both !host and memory buffer are used.
OK jung@
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 2c34c3b7041..63937e2f211 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.171 2015/07/07 17:53:04 bluhm Exp $ */ +/* $OpenBSD: syslogd.c,v 1.172 2015/07/09 16:01:48 bluhm Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -1869,6 +1869,7 @@ init(void) free(f->f_hostname); if (f->f_type == F_MEMBUF) { f->f_program = NULL; + f->f_hostname = NULL; dprintf("add %p to mb\n", f); SIMPLEQ_INSERT_HEAD(&mb, f, f_next); } else |