mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
libc: correct some memory leaks in acl_to_text(3) and acl_to_text_np(3)
PR: 275232
(cherry picked from commit 7aa375dcc6)
This commit is contained in:
parent
ddb82f214f
commit
e373880312
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue