*_retval = nsXPIDLCString::Copy(*entry);
*_retval = nsCRT::strdup(*entry);
nsCategoryManager::AddCategoryEntry( const char *aCategoryName,                                     const char *aEntryName,                                     const char *aValue,                                     PRBool aPersist,                                     PRBool aReplace,                                     char **_retval )  {    NS_ASSERTION(aCategoryName, "aCategoryName is NULL!");    NS_ASSERTION(aEntryName,    "aEntryName is NULL!");    NS_ASSERTION(aValue,        "aValue is NULL!");      /*        Note: if |_retval| is |NULL|, I won't bother returning a copy        of the replaced value.      */    if ( _retval )      *_retval = 0;      // Before we can insert a new entry, we'll need to      //  find the |CategoryNode| to put it in...    CategoryNode* category;    if ( !(category = find_category(aCategoryName)) )      {          // That category doesn't exist yet; let's make it.        category = new CategoryNode;        nsCStringKey categoryNameKey(aCategoryName);        Put(&categoryNameKey, category);      }      // See if this entry is already in this category    LeafNode* entry = category->find_leaf(aEntryName);    nsresult status = NS_OK;    if ( entry )      {          // If this entry is in the category already,          //  then you better have said 'replace'!        if ( aReplace )          {              // return the value that we're replacing            if ( _retval )              *_retval = nsXPIDLCString::Copy(*entry);          }        else          status = NS_ERROR_INVALID_ARG; // ...stops us from putting the value in      }      // If you didn't say 'replace', and there was already an entry there,      //  then we can't put your value in (that's why we set |status|, above),      //  or make it persistent (see below)    if ( NS_SUCCEEDED(status) )      { // it's OK to put a value in          // don't leak the entry we're replacing (if any)        delete entry;          // now put in the new vaentrylue        entry = new LeafNode(aValue);        nsCStringKey entryNameKey(aEntryName);        category->Put(&entryNameKey, entry);          // If you said 'persist' but not 'replace', and an entry          //  got in the way ... sorry, you won't go into the persistent store.          //  This was probably an error on your part.  If this was _really_          //  what you wanted to do, i.e., have a different value in the backing          //  store than in the live database, then do it by setting the value          //  with 'persist' and 'replace' and saving the returned old value, then          //  restoring the old value with 'replace' but _not_ 'persist'.        if ( aPersist )          status = persist(aCategoryName, aEntryName, aValue);      }    return status;  }