Bug 1486690 - Rename NS_str{,}dup and remove unnecessary checks after calls to them. r=glandium
The 'x' prefix makes it clearer that these are infallible. A couple of nsJSID methods are now also infallible.
This commit is contained in:
6
netwerk/cache/nsDiskCacheDeviceSQL.cpp
vendored
6
netwerk/cache/nsDiskCacheDeviceSQL.cpp
vendored
@@ -2344,11 +2344,7 @@ nsOfflineCacheDevice::RunSimpleQuery(mozIStorageStatement * statement,
|
||||
char **ret = static_cast<char **>(moz_xmalloc(*count * sizeof(char*)));
|
||||
|
||||
for (uint32_t i = 0; i < *count; i++) {
|
||||
ret[i] = NS_strdup(valArray[i].get());
|
||||
if (!ret[i]) {
|
||||
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(i, ret);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
ret[i] = NS_xstrdup(valArray[i].get());
|
||||
}
|
||||
|
||||
*values = ret;
|
||||
|
||||
Reference in New Issue
Block a user