Some error returns in PR_GetIPNodeByName don't properly clean up

RESOLVED FIXED in 4.1

Status

P3
normal
RESOLVED FIXED
19 years ago
19 years ago

People

(Reporter: wtc, Assigned: wtc)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

19 years ago
In prnetdb.c, PR_GetIPNodeByName, some error returns
in the #if defined(_PR_INET6) && defined(_PR_HAVE_GETHOSTBYNAME2)
block towards the end of the function (which appends
the IPv4 addresses to the end of the addr list) don't
properly clean up.

Specifically, at the two places where Alloc() fails,
the function just returns PR_FAILURE.  It does not
set the error code, and it does not unlock the dns
lock.  This can be fixed by moving that block of code
to a different function and having PR_GetIPNodeByName
call this new function.

Another problem is that we don't need to execute
that piece of code if the CopyHostent() call fails.
(Assignee)

Comment 1

19 years ago
Created attachment 9112 [details] [diff] [review]
Proposed patch.
(Assignee)

Comment 2

19 years ago
Checked in the fix on the main trunk.
/cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c, revision 3.16
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.1
You need to log in before you can comment on or make changes to this bug.