From: robertlipe Date: Mon, 24 Feb 2014 07:43:28 +0000 (+0000) Subject: Fix leak on fatal error in dbfopen. Coverity is hyper. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~198 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=660111adf8861263a605d4894bbfe39ce714397e;p=gpsbabel.git Fix leak on fatal error in dbfopen. Coverity is hyper. --- diff --git a/gpsbabel/shapelib/dbfopen.c b/gpsbabel/shapelib/dbfopen.c index 552b84377..1f717d3d1 100644 --- a/gpsbabel/shapelib/dbfopen.c +++ b/gpsbabel/shapelib/dbfopen.c @@ -686,8 +686,11 @@ DBFCreateLL( const char * pszFilename, const char * pszCodePage, SAHooks *psHook /* Create the file. */ /* -------------------------------------------------------------------- */ fp = psHooks->FOpen( pszFullname, "wb" ); - if( fp == NULL ) + if( fp == NULL ) { + free(pszBasename); + free(pszFullname); return( NULL ); + } psHooks->FWrite( &chZero, 1, 1, fp ); psHooks->FClose( fp );