IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6813


Ignore:
Timestamp:
Apr 7, 2006, 2:26:41 PM (20 years ago)
Author:
Paul Price
Message:

Plugging memory leaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c

    r6804 r6813  
    207207        }
    208208    }
     209    psFree(keywordsIter);
     210    psFree(keywords);
    209211    psTrace(__func__, 5, "Looking up %s in the CONTENTS.\n", contentsKey);
    210212    const char *content = psMetadataLookupStr(&mdok, contents, contentsKey);
     
    444446
    445447        // Need to look up what chip we have.
    446         const char *chipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu);
     448        psString chipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu);
    447449        psTrace(__func__, 5, "This is chip %s\n", chipName);
    448450        int chipNum = pmFPAFindChip(fpa, chipName); // Chip number
     
    463465            level = PM_FPA_LEVEL_CELL;
    464466            // Need to look up what cell we have.
    465             const char *cellName = phuNameFromHeader("CELL.NAME", formatSpec, phu);
     467            psString cellName = phuNameFromHeader("CELL.NAME", formatSpec, phu);
    466468            int cellNum = pmChipFindCell(chip, cellName); // Cell number
    467469            if (cellNum == -1) {
     
    472474            cell = chip->cells->data[cellNum];
    473475            view->cell = cellNum;
     476            psFree(cellName);
    474477        } else {
    475478            psError(PS_ERR_IO, true, "PHU is not FPA, CHIP or CELL.\n");
     
    477480            return NULL;
    478481        }
     482        psFree(chipName);
    479483
    480484        processContents(fpa, chip, cell, phdu, level, content, format);
     
    493497    } else {
    494498        // Get the chip
    495         const char *chipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu); // Name of the chip
     499        psString chipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu); // Name of the chip
    496500        int chipNum = pmFPAFindChip(fpa, chipName); // Chip number
    497501        if (chipNum == -1) {
     
    506510            addHDUtoChip(chip, phdu);
    507511        } else if (strcasecmp(phuType, "CELL") == 0) {
    508             const char *cellName = phuNameFromHeader("CELL.NAME", formatSpec, phu); // Name of the cell
     512            psString cellName = phuNameFromHeader("CELL.NAME", formatSpec, phu); // Name of the cell
    509513            int cellNum = pmChipFindCell(chip, cellName); // Cell number
    510514            if (cellNum == -1) {
     
    515519            cell = chip->cells->data[cellNum]; // The specified cell
    516520            view->cell = cellNum;
     521            psFree(cellName);
    517522
    518523            addHDUtoCell(cell, phdu);
     
    522527            return NULL;
    523528        }
     529        psFree(chipName);
    524530    }
    525531    psFree(phdu);
Note: See TracChangeset for help on using the changeset viewer.