Fixed three return value-checks to prevent segfaults.

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