On Mon, Jan 16, 2012 at 6:29 PM, Pete Batard <[email protected]> wrote:
> Hi, > > I've started using libcdio on Windows, and I have found a couple of memory > leaks in the library. Please find a fix for the first ones, that are > localized in iso9660. > Thanks. Patch applied. > Regards, > > /Pete > > From cfe51293a1450202a0617e76a9120a6cb8b9a821 Mon Sep 17 00:00:00 2001 > From: Pete Batard <[email protected]> > Date: Mon, 16 Jan 2012 20:02:15 +0000 > Subject: [PATCH] iso9660: fix memory leaks in iso9660_ifs_readdir() > > --- > lib/iso9660/iso9660_fs.c | 7 ++++++- > 1 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/lib/iso9660/iso9660_fs.c b/lib/iso9660/iso9660_fs.c > index 9533fcf..e918110 100644 > --- a/lib/iso9660/iso9660_fs.c > +++ b/lib/iso9660/iso9660_fs.c > @@ -1390,7 +1390,11 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char > psz_path[]) > } > > ret = iso9660_iso_seek_read (p_iso, _dirbuf, p_stat->lsn, > p_stat->secsize); > - if (ret != ISO_BLOCKSIZE*p_stat->secsize) return NULL; > + if (ret != ISO_BLOCKSIZE*p_stat->secsize) > + { > + free (_dirbuf); > + return NULL; > + } > > while (offset < (p_stat->secsize * ISO_BLOCKSIZE)) > { > @@ -1420,6 +1424,7 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char > psz_path[]) > return NULL; > } > > + free (p_stat->rr.psz_symlink); > free (p_stat); > return retval; > } > -- > 1.7.8.msysgit.0 > > >
