summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2015-05-25 22:18:39 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2015-05-25 22:18:39 +0000
commit40cebe871509a83655154b56497024e71707f19d (patch)
treeadfac1f0f014ab75789091538653321e063fde10 /sys
parent8e488a75cd80eff7cd43ac1976efcda70c942cfd (diff)
fix panic for real and revert previous rev 1.52
from markus@ sorry for the mixup
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pfkeyv2_convert.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/pfkeyv2_convert.c b/sys/net/pfkeyv2_convert.c
index 1170a0c6fcb..ab322693e78 100644
--- a/sys/net/pfkeyv2_convert.c
+++ b/sys/net/pfkeyv2_convert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2_convert.c,v 1.52 2015/05/25 18:48:17 benno Exp $ */
+/* $OpenBSD: pfkeyv2_convert.c,v 1.53 2015/05/25 22:18:38 benno Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@keromytis.org)
*
@@ -705,8 +705,10 @@ export_address(void **p, struct sockaddr *sa)
static void
import_identity(struct ipsec_id **id, struct sadb_ident *sadb_ident)
{
- if (!sadb_ident)
+ if (!sadb_ident) {
+ *id = NULL;
return;
+ }
*id = malloc(EXTLEN(sadb_ident) - sizeof(struct sadb_ident) +
sizeof(struct ipsec_id), M_CREDENTIALS, M_WAITOK);
@@ -746,10 +748,8 @@ import_identities(struct ipsec_ids **ids, int swapped,
if (*ids == tmp)
return;
}
- if (tmp->id_local != NULL)
- free(tmp->id_local, M_CREDENTIALS, 0);
- if (tmp->id_remote != NULL)
- free(tmp->id_remote, M_CREDENTIALS, 0);
+ free(tmp->id_local, M_CREDENTIALS, 0);
+ free(tmp->id_remote, M_CREDENTIALS, 0);
free(tmp, M_CREDENTIALS, 0);
}