From 85aa04fb7d1b54bb7bc46a3566aed041cfd2d2af Mon Sep 17 00:00:00 2001 From: "wtchang%redhat.com" Date: Wed, 16 Mar 2005 23:21:11 +0000 Subject: [PATCH] Bugzilla Bug 238563: added a comment that Nelson suggested in code review. git-svn-id: svn://10.0.0.236/trunk@170807 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/nsprpub/pr/src/malloc/prmem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mozilla/nsprpub/pr/src/malloc/prmem.c b/mozilla/nsprpub/pr/src/malloc/prmem.c index 1ef3d2f7c11..59077c242f8 100644 --- a/mozilla/nsprpub/pr/src/malloc/prmem.c +++ b/mozilla/nsprpub/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);