Commits

Neal Norwitz  committed 6ab15fc

Fix a couple of memory issues

  • Participants
  • Parent commits d2697c5
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Modules/_sqlite/cursor.c

         if (second_argument == NULL) {
             second_argument = PyTuple_New(0);
             if (!second_argument) {
-                return NULL;
+                goto error;
             }
         } else {
             Py_INCREF(second_argument);
         }
         if (PyList_Append(parameters_list, second_argument) != 0) {
             Py_DECREF(second_argument);
-            return NULL;
+            goto error;
         }
         Py_DECREF(second_argument);
 
         script_cstr = PyString_AsString(script_obj);
     } else if (PyUnicode_Check(script_obj)) {
         script_str = PyUnicode_AsUTF8String(script_obj);
-        if (!script_obj) {
+        if (!script_str) {
             return NULL;
         }