diff options
author | pfg <pfg@FreeBSD.org> | 2014-07-21 15:44:59 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2014-07-21 15:44:59 +0000 |
commit | f94ef3a29c0a4950b8d5be5a591ed029dd4a5764 (patch) | |
tree | 6b6b105ac6caa77faddbd827f6ebb78c977a2217 /lib/libc/stdlib | |
parent | 5221e952886075e883df133f6b07209f11cad75c (diff) | |
download | FreeBSD-src-f94ef3a29c0a4950b8d5be5a591ed029dd4a5764.zip FreeBSD-src-f94ef3a29c0a4950b8d5be5a591ed029dd4a5764.tar.gz |
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
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/hcreate.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/libc/stdlib/hcreate.c b/lib/libc/stdlib/hcreate.c index e8213f9..b3be9b4 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); } } |