Skip to content
Snippets Groups Projects
Commit 2b1f8fd1 authored by Sander Mathijs van Veen's avatar Sander Mathijs van Veen
Browse files

Fixed three return value-checks to prevent segfaults.

parent 4fac41ac
No related branches found
No related tags found
No related merge requests found
......@@ -152,6 +152,8 @@ void py_input(PyObject *parser, char *buf, int *result, int max_size)
Py_DECREF(handle);
Py_DECREF(arglist);
if (unlikely(!res)) { return; }
}
// Read the input string and catch keyboard interrupt exceptions.
......@@ -194,7 +196,7 @@ void py_input(PyObject *parser, char *buf, int *result, int max_size)
res = PyObject_CallObject(handle, arglist);
Py_DECREF(res);
Py_XDECREF(res);
Py_DECREF(handle);
Py_DECREF(arglist);
......@@ -224,7 +226,7 @@ finish_input:
res = PyObject_CallObject(handle, arglist);
Py_DECREF(res);
Py_XDECREF(res);
Py_DECREF(handle);
Py_DECREF(arglist);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment