IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 9, 2008, 1:53:19 PM (18 years ago)
Author:
eugene
Message:

add in an assert on some elements of the returned pmFPAfile; plug a leak

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfileDefine.c

    r17988 r18033  
    2121
    2222#include "pmConcepts.h"
     23
     24# define FPA_TEST_ASSERT(A){ \
     25        assert(A->format == NULL); \
     26        assert(A->formatName == NULL); \
     27        assert(A->filerule == NULL); \
     28        assert(A->filesrc == NULL); }
    2329
    2430// Parse an option from a metadata, returning the appropriate integer value
     
    511517        return NULL;
    512518    }
     519    psFree (file->filerule); // this is set in pmFPAfileDefineInput
    513520    file->format = format;
    514521    file->formatName = formatName;
    515 
    516     // adjust the rules to identify these files in the file->names data
    517522    file->filerule = psStringCopy("@FILES");
    518523    file->filesrc = psStringCopy("{CHIP.NAME}.{CELL.NAME}");
     524    // we use the above rules to identify these files in the file->names data
    519525
    520526    file->fileLevel = pmFPAPHULevel(format);
     
    655661
    656662    // define the rule to identify these files in the file->names data
     663    FPA_TEST_ASSERT (file);
    657664    psFree (file->filerule);
    658665    psFree (file->filesrc);
     
    825832        return NULL;
    826833    }
     834    FPA_TEST_ASSERT (file);
    827835    file->format = format;
    828836    file->formatName = formatName;
    829 
    830     // adjust the rules to identify these files in the file->names data
    831837    file->filerule = psStringCopy ("@FILES");
    832838    file->filesrc = psStringCopy ("{CHIP.NAME}.{CELL.NAME}");
     839    // adjust the above rules to identify these files in the file->names data
    833840
    834841    file->fileLevel = pmFPAPHULevel(format);
Note: See TracChangeset for help on using the changeset viewer.