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/map/amap/amapParse.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/map/amap/amapParse.c') 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; } -- cgit v1.2.3