diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/map/amap/amapPerm.c | 16 | 
1 files changed, 15 insertions, 1 deletions
diff --git a/src/map/amap/amapPerm.c b/src/map/amap/amapPerm.c index c5885c1f..a16e8979 100644 --- a/src/map/amap/amapPerm.c +++ b/src/map/amap/amapPerm.c @@ -114,7 +114,10 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk,          pNodFanin  = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan0) );          vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, iDsdFanin, pNodFanin );          if ( vPermFanin == NULL ) +        { +            Vec_IntFree( vPerm );              return NULL; +        }          Vec_IntForEachEntry( vPermFanin, Value, k )              Vec_IntPush( vPerm, Value );          Vec_IntFree( vPermFanin ); @@ -123,7 +126,10 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk,          pNodFanin  = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan1) );          vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, iDsdFanin, pNodFanin );          if ( vPermFanin == NULL ) +        { +            Vec_IntFree( vPerm );              return NULL; +        }          Vec_IntForEachEntry( vPermFanin, Value, k )              Vec_IntPush( vPerm, Value );          Vec_IntFree( vPermFanin ); @@ -132,7 +138,10 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk,          pNodFanin  = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan2) );          vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, iDsdFanin, pNodFanin );          if ( vPermFanin == NULL ) +        { +            Vec_IntFree( vPerm );              return NULL; +        }          Vec_IntForEachEntry( vPermFanin, Value, k )              Vec_IntPush( vPerm, Value );          Vec_IntFree( vPermFanin ); @@ -193,7 +202,12 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk,                     continue;              vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, Abc_LitRegular(iDsdFanin), pNodFanin );              if ( vPermFanin == NULL ) -                continue; +            { +                Vec_IntFree( vNodFanin ); +                Vec_IntFree( vDsdLits ); +                Vec_IntFree( vPerm ); +                return NULL; +            }              pDsdFanin->fMark = 1;              Vec_IntForEachEntry( vPermFanin, Value, j )                  Vec_IntPush( vPerm, Value );  | 
