summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2004-01-13 05:32:12 +0000
committerume <ume@FreeBSD.org>2004-01-13 05:32:12 +0000
commitfca4bcad4df2afc09ad2cd123822672a80ea5ca4 (patch)
treedac316c8fc032868d88ef10257d4689695c2fe53
parentd94f2b477c9c63c3dde78afcabdf7a8a327acc40 (diff)
downloadFreeBSD-src-fca4bcad4df2afc09ad2cd123822672a80ea5ca4.zip
FreeBSD-src-fca4bcad4df2afc09ad2cd123822672a80ea5ca4.tar.gz
fix potential 'cannot-happen' memory leak
Submitted by: "Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net> Reviewed by: itojun
-rw-r--r--sys/netinet6/ipsec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet6/ipsec.c b/sys/netinet6/ipsec.c
index 46ecaa4..917fa33 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;
/*
OpenPOWER on IntegriCloud