diff options
author | wtchang%redhat.com <devnull@localhost> | 2005-03-16 23:24:18 +0000 |
---|---|---|
committer | wtchang%redhat.com <devnull@localhost> | 2005-03-16 23:24:18 +0000 |
commit | 50aff283b4acc8f5a3eddd1393293bdc226e8d87 (patch) | |
tree | f9e3bb360553c001974ca326dd83f461abb6b410 | |
parent | d6413003ca04ba9db83f240d9d7177828566fc9a (diff) | |
download | nspr-hg-50aff283b4acc8f5a3eddd1393293bdc226e8d87.tar.gz |
Bugzilla Bug 238563: added a comment that Nelson suggested in code review.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r-- | pr/src/malloc/prmem.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pr/src/malloc/prmem.c b/pr/src/malloc/prmem.c index 1ef3d2f7..59077c24 100644 --- a/pr/src/malloc/prmem.c +++ b/pr/src/malloc/prmem.c @@ -355,6 +355,11 @@ pr_ZoneRealloc(void *oldptr, PRUint32 bytes) /* We don't know how big it is. But we can fix that. */ oldptr = realloc(oldptr, bytes); + /* + * If realloc returns NULL, this function loses the original + * value of oldptr. This isn't a leak because the caller of + * this function still has the original value of oldptr. + */ if (!oldptr) { if (bytes) { PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); |