mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-20 10:24:58 +00:00
fixed possible nullptr crash on rwlock create
This commit is contained in:
parent
81a1cbf6b1
commit
3318f12639
1 changed files with 3 additions and 1 deletions
|
@ -201,7 +201,9 @@ int PS4_SYSV_ABI scePthreadRwlockInit(OrbisPthreadRwlock* rwlock,
|
||||||
if (attr == nullptr || *attr == nullptr) {
|
if (attr == nullptr || *attr == nullptr) {
|
||||||
attr = g_pthread_cxt->getDefaultRwattr();
|
attr = g_pthread_cxt->getDefaultRwattr();
|
||||||
}
|
}
|
||||||
(*rwlock)->name = name;
|
if (name != nullptr) {
|
||||||
|
(*rwlock)->name = name;
|
||||||
|
}
|
||||||
int result = pthread_rwlock_init(&(*rwlock)->pth_rwlock, &(*attr)->attr_rwlock);
|
int result = pthread_rwlock_init(&(*rwlock)->pth_rwlock, &(*attr)->attr_rwlock);
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
LOG_ERROR(Kernel_Pthread, "scePthreadRwlockInit: error = {}", result);
|
LOG_ERROR(Kernel_Pthread, "scePthreadRwlockInit: error = {}", result);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue