summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtchang%redhat.com <devnull@localhost>2005-03-16 23:21:11 +0000
committerwtchang%redhat.com <devnull@localhost>2005-03-16 23:21:11 +0000
commit9cf38488e395ba26a45e7b4efb88cc5bae680b3c (patch)
treee9e3f96a95b45c842c54658080b39eca22ae5aa3
parentfa3dcdcc5e748439ffc4ddac388094e6f8eb485c (diff)
downloadnspr-hg-9cf38488e395ba26a45e7b4efb88cc5bae680b3c.tar.gz
Bugzilla Bug 238563: added a comment that Nelson suggested in code review.
-rw-r--r--pr/src/malloc/prmem.c5
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);