[PATCH] xfsprogs: fix potential memory free issues in quota_group_type()
Mark Tinguely
tinguely at sgi.com
Tue Sep 24 13:33:16 CDT 2013
On 09/22/13 01:45, Li Zhong wrote:
> This patch tries to fix CID 997009 reported by Coverity scan, as
> suggested by sekharan
>
> If getgroups() fails, gids might be malloced, and overwritten with &gid.
> So the free() at the end of the function is trying to free a variable on
> the stack, while the pointer to the allocated memory is lost.
>
> Signed-off-by: Li Zhong<zhong at linux.vnet.ibm.com>
> ---
Looks good to me.
And it seems that dofree would always be true in the following else
statement.
Reviewed-by: Mark Tinguely <tinguely at sgi.com>
More information about the xfs
mailing list