summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ntpd/imsg.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/ntpd/imsg.c b/usr.sbin/ntpd/imsg.c
index 41b139f4be6..8d0c0a28d78 100644
--- a/usr.sbin/ntpd/imsg.c
+++ b/usr.sbin/ntpd/imsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imsg.c,v 1.4 2004/09/16 01:02:37 henning Exp $ */
+/* $OpenBSD: imsg.c,v 1.5 2004/09/16 01:06:51 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -132,16 +132,13 @@ imsg_create(struct imsgbuf *ibuf, int type, u_int32_t peerid,
hdr.type = type;
hdr.peerid = peerid;
hdr.pid = pid;
- wbuf = buf_open(hdr.len);
- if (wbuf == NULL) {
+ if ((wbuf = buf_open(hdr.len)) == NULL) {
log_warn("imsg_create: buf_open");
return (NULL);
}
- if (buf_add(wbuf, &hdr, sizeof(hdr)) == -1) {
- log_warnx("imsg_create: buf_add error");
- buf_free(wbuf);
+ if (imsg_add(wbuf, &hdr, sizeof(hdr)) == -1)
return (NULL);
- }
+
return (wbuf);
}