diff options
author | bastiak <martin.basti@gmail.com> | 2016-04-07 10:42:52 +0200 |
---|---|---|
committer | bastiak <martin.basti@gmail.com> | 2016-04-07 10:42:52 +0200 |
commit | 9158cf3193f54b60d85e77ddbb526af4b6860145 (patch) | |
tree | 26bd710b83a5c30ebde5562569e9e3781e117cc3 | |
parent | c36aa8676abeea455570e36ed62650c75007d382 (diff) | |
download | netifaces-9158cf3193f54b60d85e77ddbb526af4b6860145.tar.gz |
Fix possible dereference of a null pointer (deftuple variable)
PyDECREF cannot be used with NULL pointer. Variable 'deftuple' may be unintialized in case that variable 'isdefault' is false. I suggest to use PyXDECREF macro instead.
-rw-r--r-- | netifaces.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/netifaces.c b/netifaces.c index 0566a7b..8b82819 100644 --- a/netifaces.c +++ b/netifaces.c @@ -1673,7 +1673,7 @@ gateways (PyObject *self) Py_DECREF (pyifname); if (tuple && !add_to_family (result, pmsg->rt.rtm_family, tuple)) { - Py_DECREF (deftuple); + Py_XDECREF (deftuple); Py_DECREF (result); free (msgbuf); close (s); |