diff options
author | wtchang%redhat.com <devnull@localhost> | 2006-10-17 17:39:26 +0000 |
---|---|---|
committer | wtchang%redhat.com <devnull@localhost> | 2006-10-17 17:39:26 +0000 |
commit | 6cd1a7cc97ded7edd1dc155ec734d8431ede970a (patch) | |
tree | 56c9b918eeb7665899694f127c1f4a5f9fa35505 | |
parent | 8ebc3389349e6c758e0d889af40969294758a149 (diff) | |
download | nspr-hg-6cd1a7cc97ded7edd1dc155ec734d8431ede970a.tar.gz |
Bugzilla Bug 335301: handle memory allocation failure in PR_OpenDir. TheMOZILLA_1_9a1_RELEASEMOZILLA_1_9a1_RC3MOZILLA_1_9a1_RC2MOZILLA_1_9a1_RC1
patch is contributed by Ryan Jones <sciguyryan+bugzilla@gmail.com>. r=wtc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r-- | pr/src/pthreads/ptio.c | 5 |
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 */ |