diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-26 12:05:59 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-26 12:05:59 (GMT) |
commit | 77af1729143a72fe96ba7c85b34ae74b104e0119 (patch) | |
tree | 2940646aaf73c2a271a35139b604bb9d3c453aa2 | |
parent | 9a2261a3729805ca5e5062c37767df80ced9e5df (diff) | |
download | cpython-77af1729143a72fe96ba7c85b34ae74b104e0119.zip cpython-77af1729143a72fe96ba7c85b34ae74b104e0119.tar.gz cpython-77af1729143a72fe96ba7c85b34ae74b104e0119.tar.bz2 |
socket.sendto(): exit directly after setting the error
Dummy change to avoid a false positive with the Clang Static Analyzer.
-rw-r--r-- | Modules/socketmodule.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 8107b98..d18b5b1 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2782,6 +2782,7 @@ sock_sendto(PySocketSockObject *s, PyObject *args) PyErr_Format(PyExc_TypeError, "sendto() takes 2 or 3 arguments (%d given)", arglen); + return NULL; } if (PyErr_Occurred()) return NULL; @@ -3144,7 +3145,7 @@ socket_gethostname(PyObject *self, PyObject *unused) } return PyErr_SetExcFromWindowsErr(PyExc_WindowsError, GetLastError()); } - return PyUnicode_FromUnicode(buf, size); + return PyUnicode_FromUnicode(buf, size); #else char buf[1024]; int res; @@ -4038,7 +4039,7 @@ socket_inet_ntop(PyObject *self, PyObject *args) static PyObject * socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs) { - static char* kwnames[] = {"host", "port", "family", "type", "proto", + static char* kwnames[] = {"host", "port", "family", "type", "proto", "flags", 0}; struct addrinfo hints, *res; struct addrinfo *res0 = NULL; @@ -4053,7 +4054,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs) family = socktype = protocol = flags = 0; family = AF_UNSPEC; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|iiii:getaddrinfo", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|iiii:getaddrinfo", kwnames, &hobj, &pobj, &family, &socktype, &protocol, &flags)) { return NULL; @@ -4289,7 +4290,7 @@ socket_if_nameindex(PyObject *self, PyObject *arg) PyObject *list; int i; struct if_nameindex *ni; - + ni = if_nameindex(); if (ni == NULL) { PyErr_SetFromErrno(socket_error); |