1. Armin Rigo
  2. cpython-withatomic

Commits

Martin von Löwis  committed 52debbc

Backport of compile.c part of r41531 (neal.norwitz, 2005-11-24):
Fix a ref leak.

  • Participants
  • Parent commits c8f87f0
  • Branches 2.4

Comments (0)

Files changed (1)

File Python/codecs.c

View file
 	goto onError;
     }
     if (!PyCallable_Check(search_function)) {
-	PyErr_SetString(PyExc_TypeError,
-			"argument must be callable");
+	PyErr_SetString(PyExc_TypeError, "argument must be callable");
 	goto onError;
     }
     return PyList_Append(interp->codec_search_path, search_function);
 			 const char *errors)
 {
     PyObject *encoder = NULL;
-    PyObject *args = NULL, *result;
+    PyObject *args = NULL, *result = NULL;
     PyObject *v;
 
     encoder = PyCodec_Encoder(encoding);
     return v;
 	
  onError:
+    Py_XDECREF(result);
     Py_XDECREF(args);
     Py_XDECREF(encoder);
     return NULL;