diff options
author | Georg Brandl <georg@python.org> | 2006-05-29 09:46:51 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-05-29 09:46:51 (GMT) |
commit | c7c51147c73984137410ec03026b77e4a76ab61e (patch) | |
tree | 4c8203e93ac28b622e4329451077c7128dd10be0 /Modules/socketmodule.c | |
parent | 964f5978dc86bd4b28a750bd93caefe18c292f4a (diff) | |
download | cpython-c7c51147c73984137410ec03026b77e4a76ab61e.zip cpython-c7c51147c73984137410ec03026b77e4a76ab61e.tar.gz cpython-c7c51147c73984137410ec03026b77e4a76ab61e.tar.bz2 |
Fix refleak in socketmodule. Replace bogus Py_BuildValue calls.
Fix refleak in exceptions.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 164a5d1..6f9f5f3 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2472,7 +2472,7 @@ sock_recvfrom_buf(PySocketSockObject *s, PyObject *args, PyObject* kwds) /* Return the number of bytes read and the address. Note that we do not do anything special here in the case that readlen < recvlen. */ - ret = PyTuple_Pack(2, PyInt_FromLong(readlen), addr); + ret = Py_BuildValue("lO", readlen, addr); finally: Py_XDECREF(addr); @@ -4364,8 +4364,10 @@ init_socket(void) PyModule_AddIntConstant(m, "BTPROTO_SCO", BTPROTO_SCO); #endif PyModule_AddIntConstant(m, "BTPROTO_RFCOMM", BTPROTO_RFCOMM); - PyModule_AddObject(m, "BDADDR_ANY", Py_BuildValue("s", "00:00:00:00:00:00")); - PyModule_AddObject(m, "BDADDR_LOCAL", Py_BuildValue("s", "00:00:00:FF:FF:FF")); + PyModule_AddObject(m, "BDADDR_ANY", + PyString_FromString("00:00:00:00:00:00")); + PyModule_AddObject(m, "BDADDR_LOCAL", + PyString_FromString("00:00:00:FF:FF:FF")); #endif #ifdef HAVE_NETPACKET_PACKET_H |