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/map/amap/amapParse.c | |
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/map/amap/amapParse.c')
-rw-r--r-- | src/map/amap/amapParse.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map/amap/amapParse.c b/src/map/amap/amapParse.c index 3ebbec11..49c1eb66 100644 --- a/src/map/amap/amapParse.c +++ b/src/map/amap/amapParse.c @@ -235,6 +235,8 @@ Hop_Obj_t * Amap_ParseFormula( FILE * pOutput, char * pFormInit, Vec_Ptr_t * vVa { fprintf( pOutput, "Amap_ParseFormula(): Unknown operation\n" ); ABC_FREE( pFormula ); + Vec_PtrFreeP( &pStackFn ); + Vec_IntFreeP( &pStackOp ); return NULL; } } @@ -333,6 +335,8 @@ Hop_Obj_t * Amap_ParseFormula( FILE * pOutput, char * pFormInit, Vec_Ptr_t * vVa { fprintf( pOutput, "Amap_ParseFormula(): Unknown operation\n" ); ABC_FREE( pFormula ); + Vec_PtrFreeP( &pStackFn ); + Vec_IntFreeP( &pStackOp ); return NULL; } Vec_IntPush( pStackOp, Oper1 ); // push the last operation back @@ -354,10 +358,10 @@ Hop_Obj_t * Amap_ParseFormula( FILE * pOutput, char * pFormInit, Vec_Ptr_t * vVa if ( Vec_PtrSize(pStackFn) == 0 ) if ( Vec_IntSize( pStackOp ) == 0 ) { - Vec_PtrFree(pStackFn); - Vec_IntFree(pStackOp); // Cudd_Deref( gFunc ); ABC_FREE( pFormula ); + Vec_PtrFreeP( &pStackFn ); + Vec_IntFreeP( &pStackOp ); return gFunc; } else @@ -369,6 +373,8 @@ Hop_Obj_t * Amap_ParseFormula( FILE * pOutput, char * pFormInit, Vec_Ptr_t * vVa fprintf( pOutput, "Amap_ParseFormula(): The input string is empty\n" ); } ABC_FREE( pFormula ); + Vec_PtrFreeP( &pStackFn ); + Vec_IntFreeP( &pStackOp ); return NULL; } |