--- a/security/manager/ssl/src/nsSmartCardMonitor.cpp
+++ b/security/manager/ssl/src/nsSmartCardMonitor.cpp
@@ -84,21 +84,18 @@ SmartCardThreadList::Remove(SECMODModule
}
// adopts the thread passwd to it. Starts the thread as well
nsresult
SmartCardThreadList::Add(SmartCardMonitoringThread *thread)
{
SmartCardThreadEntry *current = new SmartCardThreadEntry(thread, head, nullptr,
&head);
- if (current) {
- // OK to forget current here, it's on the list
- return thread->Start();
- }
- return NS_ERROR_OUT_OF_MEMORY;
+ // OK to forget current here, it's on the list
+ return thread->Start();
}
// We really should have a Unity PL Hash function...
static PLHashNumber
unity(const void *key) { return PLHashNumber(NS_PTR_TO_INT32(key)); }
SmartCardMonitoringThread::SmartCardMonitoringThread(SECMODModule *module_)
@@ -270,17 +267,17 @@ void SmartCardMonitoringThread::Execute(
PK11_GetTokenName(sle->slot), PK11_GetSlotSeries(sle->slot));
}
PK11_FreeSlotList(sl);
}
// loop starts..
do {
slot = SECMOD_WaitForAnyTokenEvent(mModule, 0, PR_SecondsToInterval(1) );
- if (slot == nullptr) {
+ if (!slot) {
break;
}
// now we have a potential insertion or removal event, see if the slot
// is present to determine which it is...
if (PK11_IsPresent(slot)) {
// insertion
CK_SLOT_ID slotID = PK11_GetSlotID(slot);