From 7495684acaaeafd590fcf067af9a1ae8ad65f12c Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Tue, 13 Jan 2004 05:32:12 +0000 Subject: [PATCH] fix potential 'cannot-happen' memory leak Submitted by: "Bjoern A. Zeeb" Reviewed by: itojun --- sys/netinet6/ipsec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/ipsec.c b/sys/netinet6/ipsec.c index 46ecaa4766c8..917fa33bb321 100644 --- a/sys/netinet6/ipsec.c +++ b/sys/netinet6/ipsec.c @@ -1311,8 +1311,11 @@ ipsec_deepcopy_policy(src) struct ipsecrequest *r; struct secpolicy *dst; + if (src == NULL) + return NULL; + dst = key_newsp(0); - if (src == NULL || dst == NULL) + if (dst == NULL) return NULL; /*