[PATCH] xfs: avoid double-free in xfs_attr_node_addname

Mark Tinguely tinguely at sgi.com
Thu Aug 1 09:18:47 CDT 2013


On 07/31/13 20:18, Eric Sandeen wrote:
> xfs_attr_node_addname()'s error handling tests whether it
> should free "state" in the out: error handling label:
>
> out:
>          if (state)
>                  xfs_da_state_free(state);
>
> but an earlier free doesn't set state to NULL afterwards; this
> could lead to a double free.  Fix it by setting state to NULL
> after it's freed.
>
> This was found by Coverity.
>
> Signed-off-by: Eric Sandeen<sandeen at redhat.com>
> ---
>
> Note: Exact same patch should hit xfsprogs - I could send another,
> or maybe SGI can just apply it in both trees?
>
> Thanks,
> -Eric

Looks good. we will discuss the details at PM phone call.

Reviewed-by: Mark Tinguely <tinguely at sgi.com>



More information about the xfs mailing list