From e19f362e282d58d90bc6ee46eaef5362db8172f8 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 15:44:59 +0000 Subject: [PATCH] Fix hdestroy() compliance issue. The hcreate(3) implementation and related functions we inherited from NetBSD used to free() the key value, something that is not supported by the standard implementation. This would cause a segmentation fault when attempting to run the examples from the opengroup and linux manpages. NetBSD has added non-standard calls to provide the previous behaviour but hdestroy is not very commonly used so at this time it seems excessive to bring those to FreeBSD. Bump the __FreeBSD_version as this is an ABI change. Reference: http://bugs.dragonflybsd.org/issues/1398 MFC after: 2 weeks --- lib/libc/stdlib/hcreate.c | 1 - sys/sys/param.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libc/stdlib/hcreate.c b/lib/libc/stdlib/hcreate.c index e8213f90b5e..b3be9b4dc43 100644 --- a/lib/libc/stdlib/hcreate.c +++ b/lib/libc/stdlib/hcreate.c @@ -159,7 +159,6 @@ hdestroy_r(struct hsearch_data *head) while (!SLIST_EMPTY(&table[idx])) { ie = SLIST_FIRST(&table[idx]); SLIST_REMOVE_HEAD(&table[idx], link); - free(ie->ent.key); free(ie); } } diff --git a/sys/sys/param.h b/sys/sys/param.h index 794a1f18e75..8920f78cb9d 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100027 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100028 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, -- 2.45.2