IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28399


Ignore:
Timestamp:
Jun 17, 2010, 2:25:17 PM (16 years ago)
Author:
Paul Price
Message:

Fix memory leak.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotFitSourcesLinear.c

    r28013 r28399  
    2727    for (int i = 0; i < num; i++) {
    2828
    29         // find the currently selected readout
    30         pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, i); // File of interest
    31         psAssert (file, "missing file?");
    32 
    33         pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
    34         psAssert (readout, "missing readout?");
    35 
    36         pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
    37         psAssert (detections, "missing detections?");
    38 
    39         psArray *sources = detections->allSources;
    40         psAssert (sources, "missing sources?");
    41 
    42         pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
    43         psAssert (psf, "missing psf?");
    44 
    45         if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final)) {
     29        // find the currently selected readout
     30        pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, i); // File of interest
     31        psAssert (file, "missing file?");
     32
     33        pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     34        psAssert (readout, "missing readout?");
     35
     36        pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     37        psAssert (detections, "missing detections?");
     38
     39        psArray *sources = detections->allSources;
     40        psAssert (sources, "missing sources?");
     41
     42        pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
     43        psAssert (psf, "missing psf?");
     44
     45        if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final)) {
    4646            psError (PSPHOT_ERR_CONFIG, false, "failed to fit sources (linear) for %s entry %d", filerule, i);
    47             return false;
    48         }
     47            return false;
     48        }
    4949    }
    5050    return true;
     
    5959
    6060    if (!sources->n) {
    61         psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping linear fit");
    62         return true;
     61        psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping linear fit");
     62        return true;
    6363    }
    6464
     
    150150
    151151    if (fitSources->n == 0) {
     152        psFree(fitSources);
    152153        return true;
    153154    }
Note: See TracChangeset for help on using the changeset viewer.