mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	Fixed reference leak in the "backslashreplace" error handler.
This commit is contained in:
		
						commit
						cbcbfdf19f
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -890,8 +890,10 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc)
 | 
				
			||||||
                ressize += 1+1+2;
 | 
					                ressize += 1+1+2;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        res = PyUnicode_New(ressize, 127);
 | 
					        res = PyUnicode_New(ressize, 127);
 | 
				
			||||||
        if (res==NULL)
 | 
					        if (res == NULL) {
 | 
				
			||||||
 | 
					            Py_DECREF(object);
 | 
				
			||||||
            return NULL;
 | 
					            return NULL;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        for (i = start, outp = PyUnicode_1BYTE_DATA(res);
 | 
					        for (i = start, outp = PyUnicode_1BYTE_DATA(res);
 | 
				
			||||||
            i < end; ++i) {
 | 
					            i < end; ++i) {
 | 
				
			||||||
            c = PyUnicode_READ_CHAR(object, i);
 | 
					            c = PyUnicode_READ_CHAR(object, i);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue