From 621411ea164f0b76d850d1ecb3b9a524d77cb9a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=D0=BD=D0=B0=D0=B1?= Date: Fri, 5 Jul 2024 23:36:31 +0200 Subject: [PATCH] archive_entry_perms.3: clarify that you don't need to strdup() [gu]name (#2239) Currently updating archivemount which does ```c pwd = getpwuid(st.st_uid); if(pwd) archive_entry_set_uname(node->entry, strdup(pwd->pw_name)); grp = getgrgid(st.st_gid); if(grp) archive_entry_set_gname(node->entry, strdup(grp->gr_name)); ``` and I'm assuming the strdups are actually leaks? The manual is silent on this. --- libarchive/archive_entry_perms.3 | 1 + 1 file changed, 1 insertion(+) diff --git a/libarchive/archive_entry_perms.3 b/libarchive/archive_entry_perms.3 index 0291b7b49..4bfbfc3c7 100644 --- a/libarchive/archive_entry_perms.3 +++ b/libarchive/archive_entry_perms.3 @@ -150,6 +150,7 @@ character strings at the same time. .Fn archive_entry_set_XXX is an alias for .Fn archive_entry_copy_XXX . +The strings are copied, and don't need to outlive the call. .Ss File Flags File flags are transparently converted between a bitmap representation and a textual format. -- 2.47.3