IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15560


Ignore:
Timestamp:
Nov 9, 2007, 2:51:47 PM (19 years ago)
Author:
eugene
Message:

updating from head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20071023/psModules/src/config/pmConfig.c

    r15516 r15560  
    510510
    511511        // Set trace destinations
    512         #ifndef PS_NO_TRACE
    513512        argNum = psArgumentGet(*argc, argv, "-tracedest");
    514513        if (argNum > 0) {
     
    531530            psWarning("Unable to set log destination to file %d\n", config->traceFD);
    532531        }
    533         #endif
    534532
    535533        // Allow command line options to override defaults for logging.
     
    553551
    554552    psString path = psMetadataLookupStr(NULL, config->site, "PATH");
     553    psString newPath = NULL;            // New path
     554    // The following gymnastics with 'newPath' are required to avoid changing the pointer out from under the
     555    // psMetadataItem on which 'path' sits (leading to memory corruption because it no longer points to valid
     556    // memory).
    555557    if (path) {
    556         psStringAppend(&path, ":%s", siteNameDir);
     558        psStringAppend(&newPath, "%s:%s", path, siteNameDir);
    557559    } else {
    558         path = psMemIncrRefCounter(siteNameDir);
    559     }
    560     pmConfigSet(path);
     560        newPath = psMemIncrRefCounter(siteNameDir);
     561    }
    561562    psFree(siteNameDir);
     563    pmConfigSet(newPath);
     564    psFree(newPath);
    562565
    563566    // Next, we do a similar thing for the camera configuration file.  The
Note: See TracChangeset for help on using the changeset viewer.