mirror of
https://github.com/python/cpython.git
synced 2025-10-14 10:53:40 +00:00
Fix memory leaks detecting in bug report #478003.
This commit is contained in:
parent
0b66310476
commit
f0b11d2893
2 changed files with 11 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue