diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2011-03-27 14:17:12 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2011-03-27 14:17:12 -0700 |
commit | 6c01e8b9f040d591f72882aff08ed21446fbb567 (patch) | |
tree | 71f04dae22291d7321e5bb244462ab1145c47ee6 /src/bdd | |
parent | 1ec437d04b2fcb42054f068525c2a1b21b69fe53 (diff) | |
download | abc-6c01e8b9f040d591f72882aff08ed21446fbb567.tar.gz abc-6c01e8b9f040d591f72882aff08ed21446fbb567.tar.bz2 abc-6c01e8b9f040d591f72882aff08ed21446fbb567.zip |
Fixed a number of small bugs and memory leaks.
Diffstat (limited to 'src/bdd')
-rw-r--r-- | src/bdd/cudd/cuddExport.c | 4 | ||||
-rw-r--r-- | src/bdd/parse/parseEqn.c | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/bdd/cudd/cuddExport.c b/src/bdd/cudd/cuddExport.c index 3b2e989d..c0cac4ec 100644 --- a/src/bdd/cudd/cuddExport.c +++ b/src/bdd/cudd/cuddExport.c @@ -780,6 +780,7 @@ Cudd_DumpDDcal( if (diff <= mask) break; } st_free_table(visited); + visited = NULL; /* Build a bit array with the support of f. */ sorted = ABC_ALLOC(int,nvars); @@ -851,7 +852,8 @@ Cudd_DumpDDcal( retval = fprintf(fp, "]\n"); if (retval == EOF) goto failure; - st_free_table(visited); + if ( visited ) + st_free_table(visited); return(1); failure: diff --git a/src/bdd/parse/parseEqn.c b/src/bdd/parse/parseEqn.c index 55b9c2f0..ed2599ca 100644 --- a/src/bdd/parse/parseEqn.c +++ b/src/bdd/parse/parseEqn.c @@ -184,6 +184,8 @@ Hop_Obj_t * Parse_FormulaParserEqn( FILE * pOutput, char * pFormInit, Vec_Ptr_t // perform the given operation if ( Parse_ParserPerformTopOp( pMan, pStackFn, Oper ) == NULL ) { + Parse_StackFnFree( pStackFn ); + Parse_StackOpFree( pStackOp ); fprintf( pOutput, "Parse_FormulaParserEqn(): Unknown operation\n" ); ABC_FREE( pFormula ); return NULL; @@ -277,6 +279,8 @@ Hop_Obj_t * Parse_FormulaParserEqn( FILE * pOutput, char * pFormInit, Vec_Ptr_t { fprintf( pOutput, "Parse_FormulaParserEqn(): Unknown operation\n" ); ABC_FREE( pFormula ); + Parse_StackFnFree( pStackFn ); + Parse_StackOpFree( pStackOp ); return NULL; } Parse_StackOpPush( pStackOp, Oper1 ); // push the last operation back |