Bug 901820 - Part 3. comm-cetral part of replacing nsCRT::strdup. r=Neil, a=jcranmer
--- a/ldap/xpcom/src/nsLDAPMessage.cpp
+++ b/ldap/xpcom/src/nsLDAPMessage.cpp
@@ -337,17 +337,17 @@ nsLDAPMessage::IterateAttributes(uint32_
if (!attr) {
return IterateAttrErrHandler(ldap_get_lderrno(mConnectionHandle, 0, 0),
aAttrCount, aAttributes, position);
}
// if we're getting attributes, try and fill in the first field
//
if (getP) {
- (*aAttributes)[0] = nsCRT::strdup(attr);
+ (*aAttributes)[0] = NS_strdup(attr);
if (!(*aAttributes)[0]) {
ldap_memfree(attr);
nsMemory::Free(*aAttributes);
return NS_ERROR_OUT_OF_MEMORY;
}
// note that we start counting again, in order to keep our place in
// the array so that we can unwind gracefully and avoid leakage if
@@ -385,17 +385,17 @@ nsLDAPMessage::IterateAttributes(uint32_
//
break;
} else if (getP) {
// if ldap_next_attribute did return successfully, and
// we're supposed to fill in a value, do so.
//
- (*aAttributes)[*aAttrCount] = nsCRT::strdup(attr);
+ (*aAttributes)[*aAttrCount] = NS_strdup(attr);
if (!(*aAttributes)[*aAttrCount]) {
ldap_memfree(attr);
return IterateAttrErrHandler(LDAP_NO_MEMORY, aAttrCount,
aAttributes, position);
}
}
ldap_memfree(attr);