summaryrefslogtreecommitdiff
path: root/pr
diff options
context:
space:
mode:
authorwtchang%redhat.com <devnull@localhost>2006-10-17 17:32:34 +0000
committerwtchang%redhat.com <devnull@localhost>2006-10-17 17:32:34 +0000
commitb664903e184cadc64470f995ef1ab1874a5ecae8 (patch)
tree6216b2167ec141965e94ab30f200a2cdfb46b94b /pr
parentaa0a2a21db30a8dda835f40452ebeca990130813 (diff)
downloadnspr-hg-b664903e184cadc64470f995ef1ab1874a5ecae8.tar.gz
Bugzilla Bug 335301: handle memory allocation failure in PR_OpenDir. The
patch is contributed by Ryan Jones <sciguyryan+bugzilla@gmail.com>. r=wtc.
Diffstat (limited to 'pr')
-rw-r--r--pr/src/pthreads/ptio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c
index ee4782db..362bc296 100644
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -3708,7 +3708,10 @@ PR_IMPLEMENT(PRDir*) PR_OpenDir(const char *name)
else
{
dir = PR_NEWZAP(PRDir);
- dir->md.d = osdir;
+ if (dir)
+ dir->md.d = osdir;
+ else
+ (void)closedir(osdir);
}
return dir;
} /* PR_OpenDir */