[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110916225626.GQ16246@thunk.org>
Date: Fri, 16 Sep 2011 18:56:26 -0400
From: Ted Ts'o <tytso@....edu>
To: Eric Sandeen <sandeen@...hat.com>
Cc: linux-ext4@...r.kernel.org
Subject: Re: [PATCH 14/25] subst: Fix free of uninit pointers
On Fri, Sep 16, 2011 at 03:49:29PM -0500, Eric Sandeen wrote:
> in add_subst(), if the malloc of ent->name fails, we goto fail;
> which will free ent->name (which is null, so OK) but also free
> ent->value (which is uninitialized). There is no case where
> we must free ent->value on an error (it is allocated last, and
> if it fails it of course doesn't need to be freed) so just
> remove it.
>
> Also "retval" is only assigned once to the constant ENOMEM,
> so we can just return that explicitly in the failure case.
>
> Signed-off-by: Eric Saneeen <sandeen@...hat.com>
> Signed-off-by: Eric Sandeen <sandeen@...hat.com>
Applied, although I removed the double sign off. :-)
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists