IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13422


Ignore:
Timestamp:
May 18, 2007, 4:02:09 AM (19 years ago)
Author:
rhl
Message:

handle NULL modelPSF; fix memory leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmPSFtry.c

    r13077 r13422  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2007-04-28 01:32:05 $
     7 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2007-05-18 14:02:09 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    116116        if (source->modelEXT == NULL) {
    117117            psError(PS_ERR_UNKNOWN, false, "failed to build model");
     118            psFree(psfTry);
    118119            return NULL;
    119120        }
     
    138139    if (!pmPSFFromPSFtry (psfTry, applyWeights)) {
    139140        psError(PS_ERR_UNKNOWN, false, "failed to construct a psf model from collection of sources");
     141        psFree(psfTry);
    140142        return NULL;
    141143    }
     
    152154        // set shape for this model based on PSF
    153155        source->modelPSF = pmModelFromPSF (source->modelEXT, psfTry->psf);
     156        if (source->modelPSF == NULL) {
     157            continue;
     158        }
    154159        source->modelPSF->radiusFit = RADIUS;
    155160
     
    272277    if (!result) {
    273278        psError(PS_ERR_UNKNOWN, false, "Failed to fit clipped poly");
     279
     280        psFree(poly);
     281        psFree(r2rflux);
     282        psFree(stats);
     283
    274284        return false;
    275285    }
Note: See TracChangeset for help on using the changeset viewer.