summaryrefslogtreecommitdiff
path: root/usr.sbin/sasyncd
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2014-10-26 14:47:38 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2014-10-26 14:47:38 +0000
commit3c4e50e3bdce706dad6c664024742278005f9b33 (patch)
tree0995a27e6beae0a3bc0598228f5166f2927d2671 /usr.sbin/sasyncd
parentf6432cb756db8d14354ab101cf1b183f06bbed59 (diff)
fix use of uninitialized variable in error path
ok deraadt@
Diffstat (limited to 'usr.sbin/sasyncd')
-rw-r--r--usr.sbin/sasyncd/pfkey.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/sasyncd/pfkey.c b/usr.sbin/sasyncd/pfkey.c
index c7cf0e4ffc9..8f8c9834418 100644
--- a/usr.sbin/sasyncd/pfkey.c
+++ b/usr.sbin/sasyncd/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.21 2014/10/16 04:05:39 deraadt Exp $ */
+/* $OpenBSD: pfkey.c,v 1.22 2014/10/26 14:47:37 chl Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -324,12 +324,12 @@ pfkey_read(void)
log_err("pfkey_read: recv() failed");
return -1;
}
+ datalen = hdr.sadb_msg_len * CHUNK;
data = reallocarray(NULL, hdr.sadb_msg_len, CHUNK);
if (!data) {
log_err("pfkey_read: malloc(%lu) failed", datalen);
return -1;
}
- datalen = hdr.sadb_msg_len * CHUNK;
msg = (struct sadb_msg *)data;
if (read(fd, data, datalen) != datalen) {