Esempio n. 1
0
static void free_coff_file_hnd( coff_file_handle coff_file_hnd )
{
    int                 loop;
    coff_sec_handle     coff_sec_hnd;

    if( coff_file_hnd->coff_sec_hnd ) {
        for( loop = 0; loop < coff_file_hnd->num_sections; loop++ ) {
            coff_sec_hnd = coff_file_hnd->coff_sec_hnd[loop];
            if( coff_sec_hnd->type == ORL_SEC_TYPE_RELOCS ) {
                if( coff_sec_hnd->assoc.reloc.relocs ) {
                    _ClientFree( coff_file_hnd, coff_sec_hnd->assoc.reloc.relocs );
                }
            }
            if( coff_sec_hnd->name_alloced ) {
                _ClientFree( coff_file_hnd, coff_sec_hnd->name );
            }
            _ClientFree( coff_file_hnd, coff_file_hnd->coff_sec_hnd[loop] );
        }
        _ClientFree( coff_file_hnd, coff_file_hnd->coff_sec_hnd );
    }
    _ClientFree( coff_file_hnd, coff_file_hnd->orig_sec_hnd );
    if( coff_file_hnd->symbol_handles ) {
        for( loop = 0; loop < coff_file_hnd->num_symbols; loop++ ) {
            if( coff_file_hnd->symbol_handles[loop].name_alloced ) {
                _ClientFree( coff_file_hnd, coff_file_hnd->symbol_handles[loop].name );
            }
            loop += coff_file_hnd->symbol_handles[loop].symbol->num_aux;
        }
        _ClientFree( coff_file_hnd, coff_file_hnd->symbol_handles );
    }
    if( coff_file_hnd->sec_name_hash_table ) {
        ORLHashTableFree( coff_file_hnd->sec_name_hash_table );
    }
    if( coff_file_hnd->implib_data != NULL ) {
        _ClientFree( coff_file_hnd, coff_file_hnd->implib_data );
    }
    _ClientFree( coff_file_hnd, coff_file_hnd );
}
Esempio n. 2
0
static void free_coff_file_hnd( coff_file_handle coff_file_hnd )
{
    coff_quantity       i;
    coff_sec_handle     coff_sec_hnd;

    if( coff_file_hnd->coff_sec_hnd != NULL ) {
        for( i = 0; i < coff_file_hnd->num_sections; ++i ) {
            coff_sec_hnd = coff_file_hnd->coff_sec_hnd[i];
            if( coff_sec_hnd->type == ORL_SEC_TYPE_RELOCS ) {
                if( coff_sec_hnd->assoc.reloc.relocs != NULL ) {
                    _ClientFree( coff_file_hnd, (void *)coff_sec_hnd->assoc.reloc.relocs );
                }
            }
            if( coff_sec_hnd->name_alloced ) {
                _ClientFree( coff_file_hnd, coff_sec_hnd->name );
            }
            _ClientFree( coff_file_hnd, coff_file_hnd->coff_sec_hnd[i] );
        }
        _ClientFree( coff_file_hnd, coff_file_hnd->coff_sec_hnd );
    }
    _ClientFree( coff_file_hnd, coff_file_hnd->orig_sec_hnd );
    if( coff_file_hnd->symbol_handles != NULL ) {
        for( i = 0; i < coff_file_hnd->num_symbols; ++i ) {
            if( coff_file_hnd->symbol_handles[i].name_alloced ) {
                _ClientFree( coff_file_hnd, coff_file_hnd->symbol_handles[i].name );
            }
            i += coff_file_hnd->symbol_handles[i].symbol->num_aux;
        }
        _ClientFree( coff_file_hnd, coff_file_hnd->symbol_handles );
    }
    if( coff_file_hnd->sec_name_hash_table != NULL ) {
        ORLHashTableFree( coff_file_hnd->sec_name_hash_table );
    }
    convert_import_library_fini( coff_file_hnd );
    _ClientFree( coff_file_hnd, coff_file_hnd );
}