From 6c01e8b9f040d591f72882aff08ed21446fbb567 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 27 Mar 2011 14:17:12 -0700 Subject: Fixed a number of small bugs and memory leaks. --- src/aig/ntl/ntlEc.c | 4 ---- src/aig/ntl/ntlReadBlif.c | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/aig/ntl') diff --git a/src/aig/ntl/ntlEc.c b/src/aig/ntl/ntlEc.c index d82ac71e..331cd906 100644 --- a/src/aig/ntl/ntlEc.c +++ b/src/aig/ntl/ntlEc.c @@ -243,8 +243,6 @@ void Ntl_ManPrepareCecMans( Ntl_Man_t * pMan1, Ntl_Man_t * pMan2, Aig_Man_t ** p Ntl_ManCreateMissingInputs( pModel1, pModel2, 0 ); if ( Ntl_ModelCombLeafNum(pModel1) != Ntl_ModelCombLeafNum(pModel2) ) { - if ( pMan1 ) Ntl_ManFree( pMan1 ); - if ( pMan2 ) Ntl_ManFree( pMan2 ); printf( "Ntl_ManPrepareCec(): Cannot verify designs with too many different CIs.\n" ); return; } @@ -253,8 +251,6 @@ void Ntl_ManPrepareCecMans( Ntl_Man_t * pMan1, Ntl_Man_t * pMan2, Aig_Man_t ** p if ( Vec_PtrSize(pMan1->vCos) == 0 ) { printf( "Ntl_ManPrepareCec(): There is no identically-named primary outputs to compare.\n" ); - if ( pMan1 ) Ntl_ManFree( pMan1 ); - if ( pMan2 ) Ntl_ManFree( pMan2 ); return; } // derive AIGs diff --git a/src/aig/ntl/ntlReadBlif.c b/src/aig/ntl/ntlReadBlif.c index 103f8540..88962efa 100644 --- a/src/aig/ntl/ntlReadBlif.c +++ b/src/aig/ntl/ntlReadBlif.c @@ -444,6 +444,7 @@ static char * Ntl_ReadLoadFile( char * pFileName ) pFile = fopen( pFileName, "rb" ); if ( pFile == NULL ) { + fclose( pFile ); printf( "Ntl_ReadLoadFile(): The file is unavailable (absent or open).\n" ); return NULL; } @@ -451,6 +452,7 @@ static char * Ntl_ReadLoadFile( char * pFileName ) nFileSize = ftell( pFile ); if ( nFileSize == 0 ) { + fclose( pFile ); printf( "Ntl_ReadLoadFile(): The file is empty.\n" ); return NULL; } -- cgit v1.2.3