Re: avoid leak upon failed realloc

2007-06-22 Thread Jeremy Allison
On Fri, Jun 22, 2007 at 04:20:20PM -0400, Theodore Tso wrote: > > Hmm There are actually several realloc calls in the tdb sources, > not just the one which Jim pointed out. If it's better I can just > simply hack one of my patches to provide a realloc wrapper that deals > with all of the case

Re: avoid leak upon failed realloc

2007-06-22 Thread Theodore Tso
On Fri, Jun 22, 2007 at 10:27:04AM -0700, Jeremy Allison wrote: > > Thanks for the patch! I actually automatically build the > > tdb.c file from the Samba SVN tree (with a series of patches and > > scripts) In case people are interested, I've attached the patches and scripts I use to build a

Re: avoid leak upon failed realloc

2007-06-22 Thread Jeremy Allison
On Fri, Jun 22, 2007 at 02:41:44AM -0400, Theodore Tso wrote: > On Mon, Jun 18, 2007 at 04:10:44PM +0200, Jim Meyering wrote: > > Here's a tiny fix to avoid a leak when realloc fails: > > > > 2007-06-16 Jim Meyering <[EMAIL PROTECTED]> > > > > * tdb.c (tdb_append): Don't leak a buffer when

Re: avoid leak upon failed realloc

2007-06-21 Thread Theodore Tso
On Mon, Jun 18, 2007 at 04:10:44PM +0200, Jim Meyering wrote: > Here's a tiny fix to avoid a leak when realloc fails: > > 2007-06-16 Jim Meyering <[EMAIL PROTECTED]> > > * tdb.c (tdb_append): Don't leak a buffer when realloc fails. Hi Jim, Thanks for the patch! I actually autom

Re: avoid leak upon failed realloc

2007-06-18 Thread Jim Meyering
Dave Kleikamp <[EMAIL PROTECTED]> wrote: > Not a big deal, but this part could be simplified to: > > if (new_dptr == NULL) > free(dbuf.dptr); > dbuf.dptr = new_dptr; Of course! Thanks! In case it helps, here's the updated patch: Here's a tiny fix

Re: avoid leak upon failed realloc

2007-06-18 Thread Dave Kleikamp
On Sat, 2007-06-16 at 19:31 +0200, Jim Meyering wrote: > Here's a tiny fix to avoid a leak when realloc fails: > > 2007-06-16 Jim Meyering <[EMAIL PROTECTED]> > > * tdb.c (tdb_append): Don't leak a buffer when realloc fails. > > diff -r 777972a573b3 lib/ext2fs/tdb.c > --- a/lib/ext2fs/td

avoid leak upon failed realloc

2007-06-16 Thread Jim Meyering
Here's a tiny fix to avoid a leak when realloc fails: 2007-06-16 Jim Meyering <[EMAIL PROTECTED]> * tdb.c (tdb_append): Don't leak a buffer when realloc fails. diff -r 777972a573b3 lib/ext2fs/tdb.c --- a/lib/ext2fs/tdb.c Fri Jun 15 18:05:09 2007 +0200 +++ b/lib/ext2fs/tdb.c Sat Jun 1