[3.14] gh-146245: Fix reference and buffer leaks via audit hook in socket module (GH-146248) (GH-146274)

(cherry picked from commit c30fae4bea)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2026-03-22 12:55:13 +01:00 committed by GitHub
parent 796513306f
commit 69a37be21c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -4795,6 +4795,7 @@ sock_sendto(PyObject *self, PyObject *args)
}
if (PySys_Audit("socket.sendto", "OO", s, addro) < 0) {
PyBuffer_Release(&pbuf);
return NULL;
}
@ -6965,7 +6966,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
if (PySys_Audit("socket.getaddrinfo", "OOiii",
hobj, pobj, family, socktype, protocol) < 0) {
return NULL;
goto err;
}
memset(&hints, 0, sizeof(hints));