diff options
-rw-r--r-- | sbin/isakmpd/ike_phase_1.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sbin/isakmpd/ike_phase_1.c b/sbin/isakmpd/ike_phase_1.c index d793d13ddbd..d6933c79290 100644 --- a/sbin/isakmpd/ike_phase_1.c +++ b/sbin/isakmpd/ike_phase_1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ike_phase_1.c,v 1.70 2007/08/05 09:43:09 tom Exp $ */ +/* $OpenBSD: ike_phase_1.c,v 1.71 2008/02/06 11:37:53 moritz Exp $ */ /* $EOM: ike_phase_1.c,v 1.31 2000/12/11 23:47:56 niklas Exp $ */ /* @@ -840,11 +840,13 @@ ike_phase_1_send_ID(struct message *msg) if (!data) { log_print("ike_phase_1_send_ID: section %s " "has no \"Address\" tag", my_id); + free(buf); return -1; } if (text2sockaddr(data, NULL, &src, af, 0)) { log_error("ike_phase_1_send_ID: " "text2sockaddr() failed"); + free(buf); return -1; } memcpy(buf + ISAKMP_ID_DATA_OFF, @@ -859,11 +861,13 @@ ike_phase_1_send_ID(struct message *msg) if (!data) { log_print("ike_phase_1_send_ID: section %s " "has no \"Network\" tag", my_id); + free(buf); return -1; } if (text2sockaddr(data, NULL, &src, af, 0)) { log_error("ike_phase_1_send_ID: " "text2sockaddr() failed"); + free(buf); return -1; } memcpy(buf + ISAKMP_ID_DATA_OFF, @@ -874,11 +878,13 @@ ike_phase_1_send_ID(struct message *msg) if (!data) { log_print("ike_phase_1_send_ID: section %s " "has no \"Netmask\" tag", my_id); + free(buf); return -1; } if (text2sockaddr(data, NULL, &src, af, 1)) { log_error("ike_phase_1_send_ID: " "text2sockaddr() failed"); + free(buf); return -1; } memcpy(buf + ISAKMP_ID_DATA_OFF + @@ -894,6 +900,7 @@ ike_phase_1_send_ID(struct message *msg) if (!data) { log_print("ike_phase_1_send_ID: section %s " "has no \"Name\" tag", my_id); + free(buf); return -1; } memcpy(buf + ISAKMP_ID_DATA_OFF, data, |