From nobody Wed Jun 10 12:36:18 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gb4yW08nYz6g4Kk for ; Wed, 10 Jun 2026 12:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gb4yV2TxSz43Nh for ; Wed, 10 Jun 2026 12:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781094978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KWiYwLZ26ulM1sTqB4E8PZ6mzmyrz8giAciHxwE3jXc=; b=lgniGYwvO2B6Aclcmpf9/wBeCPDj48ECE7lNwb2kldleyNpEtMnGgBrk1W1GoFq1PIV9oK 0bKzbfCYcP12fePqmNsHpHP69dsjdNlFM3Dw7uyOOuqfGdfGoCfmoy9FBUC3XlwDirNCz6 +yz7emEXzesR5qkOs2bLdZaG1UcUuhiMAFBxvjZCoUof5kP2xIqggnJA9Y+CmhSONDyB89 ZXnfAHgDcxNHR08BxMKd+f0sJnjKERXGHtW7WXgSZ1veYiyy6uWt1i/XcyVy8xw9vN6Pi1 BJv4gfdORFfzVEPEQU2HJBVg8pGMsUgOkPQxMCApFdLnuGwaex0rJGpJS9XRKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781094978; a=rsa-sha256; cv=none; b=dHAk7oKgA1rIvu1X7euIxLEomxykNCMStt+P2TqK8znpfmXUADcSZJdE1BtuKIAf5zQDr4 VOcag6bFMaE1BPbBMOVvK2M23Zx5qthMv9mlPKGxNoE+OYt7iPjRZE4jUA8yPrsma/B/se MnG0ZmWO2Ie8HvQkyB4NZK1FkDaiPMw94XbyzBX5NyA2QO5U3osDDsD2a3rZGt8CAaHnu/ A7vr4TFgm6kmvkvS+XgGl3crrIFuzj3aOOoU1Oy3zmFy62ruRTMMvoLO+EU8+TTW/PllnS azl5WlDD6M9xsI9XelSSmrCw0oIHGLkdfkcsBRs3dt15ZHLw1ST3l9kgPUuTnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781094978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KWiYwLZ26ulM1sTqB4E8PZ6mzmyrz8giAciHxwE3jXc=; b=rjqivqDrASef+nbms/IMjPDzvNisuAOVci/Cmvd3HRFMmLaY7WN6AcocdTu0RF5A0G9Dz6 M0FstY7qfmpxHGLecacSDnzNL8PeiflBVARbtVxWI1QR7wDeb9SicYdjPgCbKAVIEgazPn K1eIuBziXwbwXanFl8+BczX/T7zKWYuvuJn3TbNnys1W893Zn9ap9pu9Q8oHaMY3qzOWg+ AhjaROXxwXtNI7tB6uNAjX8xs6y6Ykcvh05mG/zhw1BJnTgP1oLHSOrhoVJpDrlWaYLAnr RT72OPTWagBHhFdgX7FA3dE5gN8wbkYVTuUTBK+w1tZCQl+oKMDw5bVHZRuBRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gb4yV1WmLz1KXw for ; Wed, 10 Jun 2026 12:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3da8e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 10 Jun 2026 12:36:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Kit Dallege From: Warner Losh Subject: git: ab8ceaaa86ba - main - hcreate(3): fix incorrect claim that hdestroy frees keys List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab8ceaaa86baa077fcdc020a0c05ccf88fcd54d1 Auto-Submitted: auto-generated Date: Wed, 10 Jun 2026 12:36:18 +0000 Message-Id: <6a295a42.3da8e.104bafee@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ab8ceaaa86baa077fcdc020a0c05ccf88fcd54d1 commit ab8ceaaa86baa077fcdc020a0c05ccf88fcd54d1 Author: Kit Dallege AuthorDate: 2026-03-27 01:57:10 +0000 Commit: Warner Losh CommitDate: 2026-06-10 12:35:05 +0000 hcreate(3): fix incorrect claim that hdestroy frees keys The man page incorrectly stated that hdestroy() calls free(3) for each comparison key. The implementation (hdestroy_r.c) only frees the internal table structure, not the user-provided keys or data. This matches POSIX, which says hdestroy "shall dispose of the search table" without mentioning key deallocation. Update the description to clarify that the caller is responsible for freeing any memory associated with table entries. PR: 291240 Signed-off-by: Kit Dallege Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2095 --- lib/libc/stdlib/hcreate.3 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/libc/stdlib/hcreate.3 b/lib/libc/stdlib/hcreate.3 index 4621850d4661..95a959fcedbb 100644 --- a/lib/libc/stdlib/hcreate.3 +++ b/lib/libc/stdlib/hcreate.3 @@ -26,7 +26,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 6, 2017 +.Dd June 9, 2026 .Dt HCREATE 3 .Os .Sh NAME @@ -86,10 +86,11 @@ After the call to the data can no longer be considered accessible. The .Fn hdestroy -function calls -.Xr free 3 -for each comparison key in the search table -but not the data item associated with the key. +function disposes of the search table but does not free +the comparison keys or data items stored in it. +The caller is responsible for freeing any memory associated +with table entries before calling +.Fn hdestroy . .Pp The .Fn hsearch