aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eriksson <pen@lysator.liu.se>2023-12-17 22:03:13 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2023-12-20 08:29:55 +0000
commite373880312fb8ea09c501975e1fd23234a0df1e3 (patch)
tree0176118309a582d7b608aa1af0f98fb79d3553f7
parentddb82f214f0cd5171f9830a6d28b75e8ded98613 (diff)
downloadsrc-e373880312fb8ea09c501975e1fd23234a0df1e3.tar.gz
src-e373880312fb8ea09c501975e1fd23234a0df1e3.zip
libc: correct some memory leaks in acl_to_text(3) and acl_to_text_np(3)
PR: 275232 (cherry picked from commit 7aa375dcc61e48cc56da45c9d5a11371693c8043)
-rw-r--r--lib/libc/posix1e/acl_to_text_nfs4.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/posix1e/acl_to_text_nfs4.c b/lib/libc/posix1e/acl_to_text_nfs4.c
index d901b1cf6b88..157215c9dd52 100644
--- a/lib/libc/posix1e/acl_to_text_nfs4.c
+++ b/lib/libc/posix1e/acl_to_text_nfs4.c
@@ -72,6 +72,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric)
snprintf(str, size, "user:%d", (unsigned int)*id);
else
snprintf(str, size, "user:%s", pwd->pw_name);
+ acl_free(id);
break;
case ACL_GROUP_OBJ:
@@ -91,6 +92,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric)
snprintf(str, size, "group:%d", (unsigned int)*id);
else
snprintf(str, size, "group:%s", grp->gr_name);
+ acl_free(id);
break;
case ACL_EVERYONE:
@@ -157,6 +159,7 @@ format_additional_id(char *str, size_t size, const acl_entry_t entry)
if (id == NULL)
return (-1);
snprintf(str, size, ":%d", (unsigned int)*id);
+ acl_free(id);
}
return (0);