Fix cfstore_test_delete_all by removing swap

Remove the handle swap in cfstore_test_delete_all. This prevents a
deleted handle from being used.
pull/2442/head
Russ Butler 2016-08-18 15:51:43 -05:00
parent 6a31ffbf3e
commit 81859050c3
1 changed files with 5 additions and 1 deletions

View File

@ -374,7 +374,11 @@ int32_t cfstore_test_delete_all(void)
CFSTORE_ERRLOG("%s:Error: failed to delete key_name=%s, len=%d\r\n", __func__, key_name, (int) len);
return ret;
}
CFSTORE_HANDLE_SWAP(prev, next);
ret = drv->Close(next);
if(ret < ARM_DRIVER_OK){
CFSTORE_ERRLOG("%s:Error: failed to close key_name=%s, len=%d\r\n", __func__, key_name, (int) len);
return ret;
}
}
if(ret == ARM_CFSTORE_DRIVER_ERROR_KEY_NOT_FOUND) {
/* as expected, no more keys have been found by the Find()*/