File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,8 +36,7 @@ int PyCodec_Register(PyObject *search_function)
3636 goto onError ;
3737 }
3838 if (!PyCallable_Check (search_function )) {
39- PyErr_SetString (PyExc_TypeError ,
40- "argument must be callable" );
39+ PyErr_SetString (PyExc_TypeError , "argument must be callable" );
4140 goto onError ;
4241 }
4342 return PyList_Append (interp -> codec_search_path , search_function );
@@ -305,7 +304,7 @@ PyObject *PyCodec_Encode(PyObject *object,
305304 const char * errors )
306305{
307306 PyObject * encoder = NULL ;
308- PyObject * args = NULL , * result ;
307+ PyObject * args = NULL , * result = NULL ;
309308 PyObject * v ;
310309
311310 encoder = PyCodec_Encoder (encoding );
@@ -336,6 +335,7 @@ PyObject *PyCodec_Encode(PyObject *object,
336335 return v ;
337336
338337 onError :
338+ Py_XDECREF (result );
339339 Py_XDECREF (args );
340340 Py_XDECREF (encoder );
341341 return NULL ;
Original file line number Diff line number Diff line change @@ -1801,6 +1801,7 @@ compiler_lookup_arg(PyObject *dict, PyObject *name)
18011801 if (k == NULL )
18021802 return -1 ;
18031803 v = PyDict_GetItem (dict , k );
1804+ Py_DECREF (k );
18041805 if (v == NULL )
18051806 return -1 ;
18061807 return PyInt_AS_LONG (v );
@@ -2464,6 +2465,7 @@ compiler_from_import(struct compiler *c, stmt_ty s)
24642465 }
24652466
24662467 ADDOP_O (c , LOAD_CONST , names , consts );
2468+ Py_DECREF (names );
24672469 ADDOP_NAME (c , IMPORT_NAME , s -> v .ImportFrom .module , names );
24682470 for (i = 0 ; i < n ; i ++ ) {
24692471 alias_ty alias = asdl_seq_GET (s -> v .ImportFrom .names , i );
Original file line number Diff line number Diff line change @@ -1278,8 +1278,10 @@ symtable_visit_alias(struct symtable *st, alias_ty a)
12781278 else {
12791279 if (st -> st_cur -> ste_type != ModuleBlock ) {
12801280 if (!symtable_warn (st ,
1281- "import * only allowed at module level" ))
1281+ "import * only allowed at module level" )) {
1282+ Py_DECREF (store_name );
12821283 return 0 ;
1284+ }
12831285 }
12841286 st -> st_cur -> ste_unoptimized |= OPT_IMPORT_STAR ;
12851287 Py_DECREF (store_name );
You can’t perform that action at this time.
0 commit comments