Commit c3f440f0 authored by Neal Norwitz's avatar Neal Norwitz

Fix a couple of memory issues

parent a25a6627
...@@ -443,14 +443,14 @@ PyObject* _query_execute(Cursor* self, int multiple, PyObject* args) ...@@ -443,14 +443,14 @@ PyObject* _query_execute(Cursor* self, int multiple, PyObject* args)
if (second_argument == NULL) { if (second_argument == NULL) {
second_argument = PyTuple_New(0); second_argument = PyTuple_New(0);
if (!second_argument) { if (!second_argument) {
return NULL; goto error;
} }
} else { } else {
Py_INCREF(second_argument); Py_INCREF(second_argument);
} }
if (PyList_Append(parameters_list, second_argument) != 0) { if (PyList_Append(parameters_list, second_argument) != 0) {
Py_DECREF(second_argument); Py_DECREF(second_argument);
return NULL; goto error;
} }
Py_DECREF(second_argument); Py_DECREF(second_argument);
...@@ -714,7 +714,7 @@ PyObject* cursor_executescript(Cursor* self, PyObject* args) ...@@ -714,7 +714,7 @@ PyObject* cursor_executescript(Cursor* self, PyObject* args)
script_cstr = PyString_AsString(script_obj); script_cstr = PyString_AsString(script_obj);
} else if (PyUnicode_Check(script_obj)) { } else if (PyUnicode_Check(script_obj)) {
script_str = PyUnicode_AsUTF8String(script_obj); script_str = PyUnicode_AsUTF8String(script_obj);
if (!script_obj) { if (!script_str) {
return NULL; return NULL;
} }
......
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