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 @@ -398,8 +398,10 @@ string_intern(xmlparseobject *self, const char* str)
398
398
if (!value ) {
399
399
if (PyDict_SetItem (self -> intern , result , result ) == 0 )
400
400
return result ;
401
- else
401
+ else {
402
+ Py_DECREF (result );
402
403
return NULL ;
404
+ }
403
405
}
404
406
Py_INCREF (value );
405
407
Py_DECREF (result );
@@ -547,6 +549,7 @@ my_StartElementHandler(void *userData,
547
549
flag_error (self );
548
550
Py_DECREF (n );
549
551
Py_DECREF (v );
552
+ Py_DECREF (container );
550
553
return ;
551
554
}
552
555
else {
@@ -555,12 +558,14 @@ my_StartElementHandler(void *userData,
555
558
}
556
559
}
557
560
args = string_intern (self , name );
558
- if (args != NULL )
559
- args = Py_BuildValue ("(NN)" , args , container );
560
561
if (args == NULL ) {
561
562
Py_DECREF (container );
562
563
return ;
563
564
}
565
+ args = Py_BuildValue ("(NN)" , args , container );
566
+ if (args == NULL ) {
567
+ return ;
568
+ }
564
569
/* Container is now a borrowed reference; ignore it. */
565
570
self -> in_callback = 1 ;
566
571
rv = call_with_frame (getcode (StartElement , "StartElement" , __LINE__ ),
@@ -742,7 +747,6 @@ my_ElementDeclHandler(void *userData,
742
747
}
743
748
args = Py_BuildValue ("NN" , nameobj , modelobj );
744
749
if (args == NULL ) {
745
- Py_DECREF (modelobj );
746
750
flag_error (self );
747
751
goto finally ;
748
752
}
You can’t perform that action at this time.
0 commit comments