Re: [PATCH] libmount: plug memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 30, 2011 at 07:00:58PM +0200, Karel Zak wrote:
> On Wed, Mar 30, 2011 at 06:03:00PM +0200, Petr Uzel wrote:
> > 
> > Signed-off-by: Petr Uzel <petr.uzel@xxxxxxx>
> > ---
> >  shlibs/mount/src/context.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/shlibs/mount/src/context.c b/shlibs/mount/src/context.c
> > index dba4943..ee6e225 100644
> > --- a/shlibs/mount/src/context.c
> > +++ b/shlibs/mount/src/context.c
> > @@ -1054,6 +1054,7 @@ int mnt_context_prepare_target(struct libmnt_context *cxt)
> >  		char *path = mnt_resolve_path(tgt, cache);
> >  		if (strcmp(path, tgt))
> >  			rc = mnt_fs_set_target(cxt->fs, path);
> > +		free(path);
> >  	}
> 
>  No, if the 'cache' is not NULL then the free() call is unnecessary.

 There was a leak in the cache code, fixed (commit
 2b6bd96f2b9998d573a5241c9e299ff4dd14bd2a).
 
 Thanks.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux