summaryrefslogtreecommitdiffstats
path: root/src/aig/ntl
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2011-03-27 14:17:12 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2011-03-27 14:17:12 -0700
commit6c01e8b9f040d591f72882aff08ed21446fbb567 (patch)
tree71f04dae22291d7321e5bb244462ab1145c47ee6 /src/aig/ntl
parent1ec437d04b2fcb42054f068525c2a1b21b69fe53 (diff)
downloadabc-6c01e8b9f040d591f72882aff08ed21446fbb567.tar.gz
abc-6c01e8b9f040d591f72882aff08ed21446fbb567.tar.bz2
abc-6c01e8b9f040d591f72882aff08ed21446fbb567.zip
Fixed a number of small bugs and memory leaks.
Diffstat (limited to 'src/aig/ntl')
-rw-r--r--src/aig/ntl/ntlEc.c4
-rw-r--r--src/aig/ntl/ntlReadBlif.c2
2 files changed, 2 insertions, 4 deletions
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;
}