Changeset 1728

Show
Ignore:
Timestamp:
01/03/08 20:28:10 (8 months ago)
Author:
peter
Message:

source/punch_fits.cpp:

Bug-fix - fix memory leak.

source/parse_table.cpp:
source/cdgetlinelist.cpp:
source/optimize_phymir.cpp:

Bug-fix - close open files.

source/cdinit.cpp:

Bug-fix - do not flush ioQQQ as it may not be open any longer.

source/cont_createpointers.cpp:

Bug-fix - fix out-of-bounds array access.

Location:
trunk/source
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/cdgetlinelist.cpp

    r1557 r1728  
    143143        } 
    144144 
     145        fclose( ioData ); 
     146 
    145147        /* return number of lines we found */ 
    146148        return nLines; 
  • trunk/source/cdinit.cpp

    r1726 r1728  
    250250                fprintf(ioQQQ," cdEXIT called\n"); 
    251251 
    252         /* flush ioQQQ */ 
    253         fflush( ioQQQ ); 
    254  
    255252        /* close any open units */ 
    256253        ClosePunchFiles( true ); 
  • trunk/source/cont_createpointers.cpp

    r1716 r1728  
    176176                                        /* check that energy scales are the same, to within energy resolution of arrays */ 
    177177#                                       ifndef NDEBUG 
    178                                         if( Transitions[ipISO][nelem][ipHi][ipLo].Emis->ipFine >= 0 ) 
     178                                        if( Transitions[ipISO][nelem][ipHi][ipLo].Emis->ipFine > 0 ) 
    179179                                        { 
    180180                                                realnum anuCoarse = rfield.anu[Transitions[ipISO][nelem][ipHi][ipLo].ipCont-1]; 
  • trunk/source/optimize_phymir.cpp

    r1557 r1728  
    171171                        yp[0] = (realnum)optimize_func(xc); 
    172172                        wr_block(&yp[0],(size_t)sizeof(realnum),fnam1); 
     173                        fclose( ioQQQ ); 
    173174                        cdEXIT(EXIT_SUCCESS); 
    174175                } 
     
    291292                                        yp[jj] = (realnum)optimize_func(xhlp); 
    292293                                        wr_block(&yp[jj],(size_t)sizeof(realnum),fnam1); 
     294                                        fclose( ioQQQ ); 
    293295                                        cdEXIT(EXIT_SUCCESS); 
    294296                                } 
  • trunk/source/parse_table.cpp

    r1711 r1728  
    225225                } 
    226226        } 
     227 
     228        fclose( ioFILE ); 
    227229 
    228230        { 
  • trunk/source/punch_fits.cpp

    r1562 r1728  
    718718                bytesAdded += (long)fwrite( &tempInt, 1, 1,   ioFITS_OUTPUT ); 
    719719        } 
     720 
     721        free( TransmittedSpectrum ); 
    720722        return; 
    721723}