From: Mark Tinguely <tinguely@sgi.com>
To: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Chandra Seetharaman <sekharan@us.ibm.com>, xfsprogs <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfsprogs: fix potential memory free issues in quota_group_type()
Date: Tue, 24 Sep 2013 13:33:16 -0500 [thread overview]
Message-ID: <5241DAEC.8080109@sgi.com> (raw)
In-Reply-To: <1379832353.4089.10.camel@ThinkPad-T5421>
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@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@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2013-09-24 18:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-22 6:45 [PATCH] xfsprogs: fix potential memory free issues in quota_group_type() Li Zhong
2013-09-24 18:33 ` Mark Tinguely [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5241DAEC.8080109@sgi.com \
--to=tinguely@sgi.com \
--cc=sekharan@us.ibm.com \
--cc=xfs@oss.sgi.com \
--cc=zhong@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox