IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2009, 11:33:02 AM (17 years ago)
Author:
bills
Message:

plug memory leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/warpedpixels.c

    r21156 r21438  
    2222    int n = psArrayLength(skycells);
    2323
    24     psRegion     bounds = *pmChipPixels(sf->chip);
     24    psRegion     *bounds = pmChipPixels(sf->chip);
    2525   
    26     int width  = bounds.x1 - bounds.x0;
    27     int height = bounds.y1 - bounds.y0;
     26    int width  = bounds->x1 - bounds->x0;
     27    int height = bounds->y1 - bounds->y0;
     28
     29    psFree(bounds);
    2830
    2931    sf->warpedPixels = psImageAlloc(width, height, PS_TYPE_U8);
     
    3537
    3638        addTouchedPixels(sf, resolved_name);
     39        psFree(resolved_name);
    3740    }
    3841
     
    4851        psFitsWriteImage(fits, header, sf->warpedPixels, 0, NULL);
    4952        psFitsClose(fits);
     53        psFree(header);
    5054    }
    5155    return true;
     
    6266    }
    6367    psMetadata *header = psFitsReadHeader(NULL, fits);
     68    psFitsClose(fits);
    6469    if (!header) {
    6570        psError(PS_ERR_IO, false, "failed to read fixts header from skycell file: %s", fileName);
     
    7580    int naxis2 = psMetadataLookupS32(NULL, header, "NAXIS2");
    7681
     82    psFree(header);
     83
    7784    /* now set up our wrapper to the chip astrometry to apply to the whole chip */
    7885    sf->astrom = streakSetAstrometry(sf->astrom, sf->stage, sf->inAstrom->fpa, sf->chip, false, NULL,
     
    111118        pt[i].y = p.y;
    112119    }
     120
     121    psFree(wcs);
    113122
    114123    // put the corners in the desired order (see comments below)
Note: See TracChangeset for help on using the changeset viewer.