From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 85FA229E0B for ; Tue, 24 Sep 2013 13:33:20 -0500 (CDT) Message-ID: <5241DAEC.8080109@sgi.com> Date: Tue, 24 Sep 2013 13:33:16 -0500 From: Mark Tinguely MIME-Version: 1.0 Subject: Re: [PATCH] xfsprogs: fix potential memory free issues in quota_group_type() References: <1379832353.4089.10.camel@ThinkPad-T5421> In-Reply-To: <1379832353.4089.10.camel@ThinkPad-T5421> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Li Zhong Cc: Chandra Seetharaman , xfsprogs 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 > --- Looks good to me. And it seems that dofree would always be true in the following else statement. Reviewed-by: Mark Tinguely _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs