From 303993803a903836ebdee023fdaa9f772f2fcb05 Mon Sep 17 00:00:00 2001 From: daniel <> Date: Mon, 10 Aug 2026 22:02:41 +0000 Subject: hdestroy(3): stop freeing key values POSIX leaves ownership of ENTRY.key with the caller. Our current behaviour came from NetBSD when this code was imported in 2004. NetBSD and FreeBSD both stopped freeing key values in July 2014. NetBSD in commit fe0a1a6 and FreeBSD in commit e19f362. Remove the call to free(3) to align ourselves with NetBSD, FreeBSD and POSIX. Also adjust rsync for the change in semantics. Flagged by Sortix os-test. ok millert@, deraadt@ --- src/lib/libc/stdlib/hcreate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/lib/libc/stdlib/hcreate.c') diff --git a/src/lib/libc/stdlib/hcreate.c b/src/lib/libc/stdlib/hcreate.c index b31108a90e..ca6d8d16c4 100644 --- a/src/lib/libc/stdlib/hcreate.c +++ b/src/lib/libc/stdlib/hcreate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hcreate.c,v 1.7 2016/05/29 20:47:49 guenther Exp $ */ +/* $OpenBSD: hcreate.c,v 1.8 2026/08/10 22:02:41 daniel Exp $ */ /* $NetBSD: hcreate.c,v 1.5 2004/04/23 02:48:12 simonb Exp $ */ /* @@ -142,7 +142,6 @@ hdestroy(void) while (!SLIST_EMPTY(&htable[idx])) { ie = SLIST_FIRST(&htable[idx]); SLIST_REMOVE_HEAD(&htable[idx], link); - free(ie->ent.key); free(ie); } } -- cgit v1.2.3-55-g6feb