diff --git a/src/fedex_plus/multpass.c b/src/fedex_plus/multpass.c index ebb223dc..eeed660c 100644 --- a/src/fedex_plus/multpass.c +++ b/src/fedex_plus/multpass.c @@ -42,6 +42,7 @@ int isAggregateType( const Type t ); /* Local function prototypes: */ static void initializeMarks( Express ); +static void cleanupMarks( Express ); static void unsetObjs( Schema ); static int checkTypes( Schema ); static int checkEnts( Schema ); @@ -166,6 +167,9 @@ void print_schemas_separate( Express express, void * complexCol, FILES * files ) // files. This is done in a separate loop through the schemas, in function // below. */ getMCPrint( express, files->incall, files->initall ); + + /* Finally clean up memory allocated by initializeMarks. */ + cleanupMarks( express ); } static void initializeMarks( Express express ) @@ -196,6 +200,19 @@ static void initializeMarks( Express express ) } } +static void cleanupMarks( Express express ) { + DictionaryEntry de_sch, de_ent, de_type; + Schema schema; + + DICTdo_type_init( express->symbol_table, &de_sch, OBJ_SCHEMA ); + while( ( schema = ( Scope )DICTdo( &de_sch ) ) != 0 ) { + if ( schema->clientData ) { + scl_free( schema->clientData ); + schema->clientData = NULL; + } + } +} + static void unsetObjs( Schema schema ) /* * Resets all the ents & types of schema which had been set to CANTPROCRSS