зеркало из https://github.com/mozilla/pjs.git
Bugzilla bug 226356: test for NULL before dereferencing a pointer. The
patch is contributed by timeless@bemail.org. r=wtc. Modified Files: bthreads/btmon.c pthreads/ptsynch.c threads/prmon.c
This commit is contained in:
Родитель
10c3b4308c
Коммит
36d3a9d16a
|
@ -78,7 +78,10 @@ PR_IMPLEMENT(PRMonitor*)
|
|||
PR_IMPLEMENT(PRMonitor*) PR_NewNamedMonitor(const char* name)
|
||||
{
|
||||
PRMonitor* mon = PR_NewMonitor();
|
||||
mon->name = name;
|
||||
if( mon )
|
||||
{
|
||||
mon->name = name;
|
||||
}
|
||||
return mon;
|
||||
}
|
||||
|
||||
|
|
|
@ -471,7 +471,8 @@ PR_IMPLEMENT(PRMonitor*) PR_NewMonitor(void)
|
|||
PR_IMPLEMENT(PRMonitor*) PR_NewNamedMonitor(const char* name)
|
||||
{
|
||||
PRMonitor* mon = PR_NewMonitor();
|
||||
mon->name = name;
|
||||
if (mon)
|
||||
mon->name = name;
|
||||
return mon;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,8 @@ PR_IMPLEMENT(PRMonitor*) PR_NewMonitor()
|
|||
PR_IMPLEMENT(PRMonitor*) PR_NewNamedMonitor(const char* name)
|
||||
{
|
||||
PRMonitor* mon = PR_NewMonitor();
|
||||
mon->name = name;
|
||||
if (mon)
|
||||
mon->name = name;
|
||||
return mon;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче