IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14958


Ignore:
Timestamp:
Sep 20, 2007, 4:02:53 PM (19 years ago)
Author:
Paul Price
Message:

Plugging memory leak from not freeing rawExp before "continue".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/regtool.c

    r14214 r14958  
    119119    // select newImfiles that:
    120120    // exp_id is in newExp
    121     // don't have their exp_id in rawExp 
     121    // don't have their exp_id in rawExp
    122122    // XXX having the same exp_id in newExp and raw*Exp is probably an error
    123123    // that should be checked for
     
    137137
    138138    if (!p_psDBRunQuery(config->dbh, query)) {
    139         // XXX PS_EXIT_PROG_ERROR (incorrect SQL) or SYS_ERROR (database comms)
     139        // XXX PS_EXIT_PROG_ERROR (incorrect SQL) or SYS_ERROR (database comms)
    140140        psError(PXTOOLS_ERR_PROG, false, "database error");
    141141        psFree(query);
     
    155155                psError(PXTOOLS_ERR_PROG, false, "unknown error");
    156156        }
    157        
     157
    158158        return false;
    159159    }
     
    167167    simple = psMetadataLookupBool(&status, config->args, "-simple");
    168168    if (!status) {
    169         psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -simple");
    170         return false;
     169        psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -simple");
     170        return false;
    171171    }
    172172
     
    278278            newImfileRow *object = newImfileObjectFromMetadata(output->data[i]);
    279279            // convert newImfile object -> rawImfile object
    280             rawImfileRow *imfile = newToRawImfile(config, object); 
     280            rawImfileRow *imfile = newToRawImfile(config, object);
    281281            if (!imfile) {
    282282                // rollback
     
    482482
    483483    // return only exps that:
    484     // are not in rawExp 
     484    // are not in rawExp
    485485    // have ALL of their imfiles in rawImfile (by count)
    486486    // and have no associated imfiles left in newImfile
     
    499499
    500500    if (!p_psDBRunQuery(config->dbh, query)) {
    501         // XXX PS_EXIT_PROG_ERROR (incorrect SQL) or SYS_ERROR (database comms)
     501        // XXX PS_EXIT_PROG_ERROR (incorrect SQL) or SYS_ERROR (database comms)
    502502        psError(PXTOOLS_ERR_PROG, false, "database error");
    503503        psFree(query);
     
    529529    simple = psMetadataLookupBool(&status, config->args, "-simple");
    530530    if (!status) {
    531         psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -simple");
    532         return false;
     531        psError(PXTOOLS_ERR_PROG, false, "failed to lookup value for -simple");
     532        return false;
    533533    }
    534534
     
    554554    // exp_id is not in newImfile
    555555    // that the correct count of imfiles is in rawImfile
    556    
     556
    557557    bool status = false;
    558558    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
     
    672672        // done)
    673673        if (detrend) {
    674             // set the state for the newExp to stop 
     674            // set the state for the newExp to stop
    675675            if (!pxnewExpSetState(config, exp_id, "stop")) {
    676676                // rollback
     
    683683                return false;
    684684            }
     685            psFree(rawExp);
    685686            continue;
    686687        }
Note: See TracChangeset for help on using the changeset viewer.