File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -245,8 +245,10 @@ string_intern(xmlparseobject *self, const char* str)
245
245
if (!value ) {
246
246
if (PyDict_SetItem (self -> intern , result , result ) == 0 )
247
247
return result ;
248
- else
248
+ else {
249
+ Py_DECREF (result );
249
250
return NULL ;
251
+ }
250
252
}
251
253
Py_INCREF (value );
252
254
Py_DECREF (result );
@@ -395,6 +397,7 @@ my_StartElementHandler(void *userData,
395
397
flag_error (self );
396
398
Py_DECREF (n );
397
399
Py_DECREF (v );
400
+ Py_DECREF (container );
398
401
return ;
399
402
}
400
403
else {
@@ -403,12 +406,14 @@ my_StartElementHandler(void *userData,
403
406
}
404
407
}
405
408
args = string_intern (self , name );
406
- if (args != NULL )
407
- args = Py_BuildValue ("(NN)" , args , container );
408
409
if (args == NULL ) {
409
410
Py_DECREF (container );
410
411
return ;
411
412
}
413
+ args = Py_BuildValue ("(NN)" , args , container );
414
+ if (args == NULL ) {
415
+ return ;
416
+ }
412
417
/* Container is now a borrowed reference; ignore it. */
413
418
self -> in_callback = 1 ;
414
419
rv = call_with_frame ("StartElement" , __LINE__ ,
@@ -567,7 +572,6 @@ my_ElementDeclHandler(void *userData,
567
572
}
568
573
args = Py_BuildValue ("NN" , nameobj , modelobj );
569
574
if (args == NULL ) {
570
- Py_DECREF (modelobj );
571
575
flag_error (self );
572
576
goto finally ;
573
577
}
You can’t perform that action at this time.
0 commit comments