summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ipsp.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-11-29 15:40:00 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-11-29 15:40:00 +0000
commit3525936ff6583017c15a010a7cae0020809cab8a (patch)
tree0814cbb5ce892b144458fcd56e2bcc1c83480828 /sys/netinet/ip_ipsp.c
parentf2f726fdb610c068aa8707f9d159ae9e6a912b7c (diff)
Using a void pointer for temporary allocated TDB in pfkeyv2 does
not make sense. Do not use the freeme pointer for TDB in pfkeyv2_send(). The pattern is tdb_alloc() and tdb_unref() in case of error. Replace tdb_free() in reserve_spi() with tdb_unref() to keep this consistent. Only tdb_unref() should call tdb_free(). OK mvs@
Diffstat (limited to 'sys/netinet/ip_ipsp.c')
-rw-r--r--sys/netinet/ip_ipsp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index 04346c3bcb0..21be98c83a2 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.256 2021/11/26 19:24:41 bluhm Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.257 2021/11/29 15:39:59 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -324,7 +324,7 @@ reserve_spi(u_int rdomain, u_int32_t sspi, u_int32_t tspi,
}
(*errval) = EEXIST;
- tdb_free(tdbp);
+ tdb_unref(tdbp);
return 0;
}