Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f0b11d28
Commit
f0b11d28
authored
Nov 07, 2001
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memory leaks detecting in bug report #478003.
parent
0b663104
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
Modules/getaddrinfo.c
Modules/getaddrinfo.c
+6
-4
Modules/socketmodule.c
Modules/socketmodule.c
+5
-1
No files found.
Modules/getaddrinfo.c
View file @
f0b11d28
...
...
@@ -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
;
}
Modules/socketmodule.c
View file @
f0b11d28
...
...
@@ -606,6 +606,7 @@ setipaddr(char* name, struct sockaddr * addr_ret, int af)
return
-
1
;
}
if
(
res
->
ai_next
)
{
freeaddrinfo
(
res
);
PyErr_SetString
(
PySocket_Error
,
"wildcard resolved to multiple address"
);
return
-
1
;
...
...
@@ -2461,7 +2462,8 @@ PySocket_inet_ntoa(PyObject *self, PyObject *args)
static
PyObject
*
PySocket_getaddrinfo
(
PyObject
*
self
,
PyObject
*
args
)
{
struct
addrinfo
hints
,
*
res0
,
*
res
;
struct
addrinfo
hints
,
*
res
;
struct
addrinfo
*
res0
=
NULL
;
PyObject
*
pobj
=
(
PyObject
*
)
NULL
;
char
pbuf
[
30
];
char
*
hptr
,
*
pptr
;
...
...
@@ -2522,6 +2524,8 @@ PySocket_getaddrinfo(PyObject *self, PyObject *args)
err:
Py_XDECREF
(
single
);
Py_XDECREF
(
all
);
if
(
res0
)
freeaddrinfo
(
res0
);
return
(
PyObject
*
)
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment