diff options
author | ume <ume@FreeBSD.org> | 2004-01-13 05:32:12 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2004-01-13 05:32:12 +0000 |
commit | fca4bcad4df2afc09ad2cd123822672a80ea5ca4 (patch) | |
tree | dac316c8fc032868d88ef10257d4689695c2fe53 | |
parent | d94f2b477c9c63c3dde78afcabdf7a8a327acc40 (diff) | |
download | FreeBSD-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.c | 5 |
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; /* |