From 05b2d323516595530a6810efcad04e3bf5bf56a5 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 6 May 2009 20:34:28 +0000 Subject: [PATCH] Closing #3874: * fixed a couple of memory leaks in the BeOS-specific (attribute related) code of zip git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30653 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/zip/beos.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bin/zip/beos.c b/src/bin/zip/beos.c index 4dce00e4b5..113a6bb944 100644 --- a/src/bin/zip/beos.c +++ b/src/bin/zip/beos.c @@ -746,6 +746,8 @@ local int add_Be_ef( struct zlist far *z ) compbuff = attrbuff; flags = EB_BE_FL_NATURAL; + } else { + free( attrbuff ); } /* Check to see if we really have enough room in the EF for the data. */ @@ -761,6 +763,7 @@ local int add_Be_ef( struct zlist far *z ) z->ext = 0; } if( l_ef == NULL ) { + free( compbuff ); return ZE_MEM; } z->extra = l_ef; @@ -773,6 +776,7 @@ local int add_Be_ef( struct zlist far *z ) z->cext = 0; } if( c_ef == NULL ) { + free( compbuff ); return ZE_MEM; } z->cextra = c_ef; @@ -805,6 +809,8 @@ local int add_Be_ef( struct zlist far *z ) z->cext += EB_C_BE_SIZE; + free( compbuff ); + return ZE_OK; }