diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2002-11-06 23:57:37 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2002-11-06 23:57:37 +0000 |
commit | a0b4583c830bb8a20f55e70c3605c9b44be2ada4 (patch) | |
tree | 9dfdbf3cae153ad72dd7d95d96dc762c10805983 /sbin | |
parent | 3db638110f445fdee0af026ba42b338baa48ae85 (diff) |
More careful will alloc/free. Spotted by Aref Taidi.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/isakmpd/exchange.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sbin/isakmpd/exchange.c b/sbin/isakmpd/exchange.c index 592fbee1e31..d2413af23ee 100644 --- a/sbin/isakmpd/exchange.c +++ b/sbin/isakmpd/exchange.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exchange.c,v 1.70 2002/09/11 09:50:43 ho Exp $ */ +/* $OpenBSD: exchange.c,v 1.71 2002/11/06 23:57:36 ho Exp $ */ /* $EOM: exchange.c,v 1.143 2000/12/04 00:02:25 angelos Exp $ */ /* @@ -862,6 +862,11 @@ exchange_establish_p1 (struct transport *t, u_int8_t type, u_int32_t doi, #endif msg = message_alloc (t, 0, ISAKMP_HDR_SZ); + if (!msg) + { + log_print ("exchange_establish_p1: message_alloc () failed"); + exchange_free (exchange); + } msg->exchange = exchange; /* Do not create SA for an information or transaction exchange. */ @@ -878,6 +883,7 @@ exchange_establish_p1 (struct transport *t, u_int8_t type, u_int32_t doi, if (!msg->isakmp_sa) { /* XXX Do something more here? */ + message_free (msg); exchange_free (exchange); return; } |