From 3e9ba4a2d88b8783c3d04fb4089aa904597e1970 Mon Sep 17 00:00:00 2001 From: tobhe Date: Thu, 21 Mar 2024 22:08:49 +0000 Subject: [PATCH] Avoid redundant allocation in ikev2_prfplus() from markus@ --- sbin/iked/ikev2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c index d5cc0ed52bd..c0add7c3894 100644 --- a/sbin/iked/ikev2.c +++ b/sbin/iked/ikev2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ikev2.c,v 1.385 2024/03/02 16:16:07 tobhe Exp $ */ +/* $OpenBSD: ikev2.c,v 1.386 2024/03/21 22:08:49 tobhe Exp $ */ /* * Copyright (c) 2019 Tobias Heider @@ -5933,8 +5933,7 @@ ikev2_prfplus(struct iked_hash *prf, struct ibuf *key, struct ibuf *seed, for (i = 0; i < rlen; i++) { if (t1 != NULL) { - t2 = ibuf_new(ibuf_data(t1), ibuf_size(t1)); - ibuf_free(t1); + t2 = t1; } else t2 = ibuf_new(NULL, 0); t1 = ibuf_new(NULL, hash_keylength(prf)); -- 2.20.1