summaryrefslogtreecommitdiffstats
path: root/Modules/getaddrinfo.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-11-07 08:31:03 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-11-07 08:31:03 (GMT)
commitf0b11d28937c826054f662b4958d3d637bf42fd0 (patch)
treed4092f2bbe7b9e7459e28113183fe29fa826ab1b /Modules/getaddrinfo.c
parent0b663104760b6d32bb6dfb49ef45194de6c05a66 (diff)
downloadcpython-f0b11d28937c826054f662b4958d3d637bf42fd0.zip
cpython-f0b11d28937c826054f662b4958d3d637bf42fd0.tar.gz
cpython-f0b11d28937c826054f662b4958d3d637bf42fd0.tar.bz2
Fix memory leaks detecting in bug report #478003.
Diffstat (limited to 'Modules/getaddrinfo.c')
-rw-r--r--Modules/getaddrinfo.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/getaddrinfo.c b/Modules/getaddrinfo.c
index 5d137d8..5d92608 100644
--- a/Modules/getaddrinfo.c
+++ b/Modules/getaddrinfo.c
@@ -571,12 +571,14 @@ get_addr(hostname, af, res, pai, port0)
error = EAI_FAIL;
break;
}
- goto bad;
+ goto free;
}
if ((hp->h_name == NULL) || (hp->h_name[0] == 0) ||
- (hp->h_addr_list[0] == NULL))
- ERR(EAI_FAIL);
+ (hp->h_addr_list[0] == NULL)) {
+ error = EAI_FAIL;
+ goto free;
+ }
for (i = 0; (ap = hp->h_addr_list[i]) != NULL; i++) {
switch (af) {
@@ -632,7 +634,7 @@ get_addr(hostname, af, res, pai, port0)
if (hp)
freehostent(hp);
#endif
- bad:
+/* bad: */
*res = NULL;
return error;
}