Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix potential resource leak #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/base/abci/abcMv.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ void Abc_MvRead( Mv_Man_t * p )
Cudd_RecursiveDeref( p->dd, bTemp );
Cudd_RecursiveDeref( p->dd, bCube );
}
flose(pFile);

// add the complement of the domain to all values
for ( i = 0; i < 15; i++ )
Expand Down
3 changes: 3 additions & 0 deletions src/base/abci/abcScorr.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,11 @@ Abc_Ntk_t * Abc_NtkTestScorr( char * pFileNameIn, char * pFileNameOut, int nStep
Abc_NtkDelete( pLogic );
Abc_NtkDelete( pNetlist );
printf( "Deriving strashed network from input file %s has failed.\n", pFileNameIn );
fclose( pFile );
return NULL;
}
fclose( pFile );

pAig = Abc_NtkToDar( pStrash, 0, 1 ); // performs "zero" internally
// the newer computation (&scorr)
if ( fNewAlgo )
Expand Down
3 changes: 3 additions & 0 deletions src/base/acb/acbFunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,10 @@ void Acb_GenerateFileOut( Vec_Str_t * vPatchLine, char * pFileNameF, char * pFil
// output file
pFileOut = fopen( pFileNameOut, "wb" );
if ( !pFileOut )
{
fclose( pFileIn );
return;
}
// copy line by line
while ( fgets(pBuffer, 10000, pFileIn) )
{
Expand Down
1 change: 1 addition & 0 deletions src/base/io/ioReadPlaMo.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ char * Mop_ManLoadFile( char * pFileName )
if ( nFileSize == 0 )
{
Abc_Print( -1, "Mop_ManLoadFile(): The file is empty.\n" );
fclose( pFile );
return NULL;
}
pContents = ABC_ALLOC( char, nFileSize + 10 );
Expand Down
1 change: 1 addition & 0 deletions src/bool/lucky/luckySwapIJ.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ void swap_ij_case3( word* f,int totalVars, int i, int j)
memcpy(&f[x],&f[x+shift],SizeOfBlock);
memcpy(&f[x+shift],temp,SizeOfBlock);
}
free( temp );
}
void swap_ij( word* f,int totalVars, int varI, int varJ)
{
Expand Down
2 changes: 2 additions & 0 deletions src/map/fpga/fpgaLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ Fpga_LutLib_t * Fpga_LutLibRead( char * FileName, int fVerbose )
}
i++;
}
fclose( pFile );

p->LutMax = i-1;
/*
if ( p->LutMax > FPGA_MAX_LEAVES )
Expand Down
1 change: 1 addition & 0 deletions src/map/if/ifDsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,7 @@ If_DsdMan_t * If_DsdManLoad( char * pFileName )
RetValue = fread( pBuffer, 4, 1, pFile );
if ( strncmp(pBuffer, DSD_VERSION, strlen(DSD_VERSION)) )
{
fclose( pFile );
printf( "Unrecognized format of file \"%s\".\n", pFileName );
return NULL;
}
Expand Down