Changeset 15560
- Timestamp:
- Nov 9, 2007, 2:51:47 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20071023/psModules/src/config/pmConfig.c
r15516 r15560 510 510 511 511 // Set trace destinations 512 #ifndef PS_NO_TRACE513 512 argNum = psArgumentGet(*argc, argv, "-tracedest"); 514 513 if (argNum > 0) { … … 531 530 psWarning("Unable to set log destination to file %d\n", config->traceFD); 532 531 } 533 #endif534 532 535 533 // Allow command line options to override defaults for logging. … … 553 551 554 552 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). 555 557 if (path) { 556 psStringAppend(& path, ":%s", siteNameDir);558 psStringAppend(&newPath, "%s:%s", path, siteNameDir); 557 559 } else { 558 path = psMemIncrRefCounter(siteNameDir); 559 } 560 pmConfigSet(path); 560 newPath = psMemIncrRefCounter(siteNameDir); 561 } 561 562 psFree(siteNameDir); 563 pmConfigSet(newPath); 564 psFree(newPath); 562 565 563 566 // Next, we do a similar thing for the camera configuration file. The
Note:
See TracChangeset
for help on using the changeset viewer.
