IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28321


Ignore:
Timestamp:
Jun 14, 2010, 5:23:06 PM (16 years ago)
Author:
Paul Price
Message:

Copy the metadata item to allow use of the same argument item in more than one place

File:
1 edited

Legend:

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

    r28271 r28321  
    250250        psMetadataItem *item = NULL;
    251251        while ((item = psListGetAndIncrement(iter))) {
     252            psMetadataItem *new = psMetadataItemCopy(item);
    252253            // need to change the name and comment
    253             psFree (item->name);
    254             item->name = psStringCopy (field);
    255             psFree (item->comment);
    256             item->comment = psStringCopy (op);
    257             if (!psMetadataAddItem(where, item, PS_LIST_TAIL, PS_META_DUPLICATE_OK)) {
     254            psFree (new->name);
     255            new->name = psStringCopy (field);
     256            psFree (new->comment);
     257            new->comment = psStringCopy (op);
     258            if (!psMetadataAddItem(where, new, PS_LIST_TAIL, PS_META_DUPLICATE_OK)) {
    258259                psError(psErrorCodeLast(), false, "failed to add item %s", field);
    259260                psFree(where);
     
    261262            }
    262263        }
    263         psFree (iter);
     264        psFree(iter);
    264265    }
    265266    return true;
Note: See TracChangeset for help on using the changeset viewer.