File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -243,8 +243,10 @@ string_intern(xmlparseobject *self, const char* str)
243243 if (!value ) {
244244 if (PyDict_SetItem (self -> intern , result , result ) == 0 )
245245 return result ;
246- else
246+ else {
247+ Py_DECREF (result );
247248 return NULL ;
249+ }
248250 }
249251 Py_INCREF (value );
250252 Py_DECREF (result );
@@ -393,6 +395,7 @@ my_StartElementHandler(void *userData,
393395 flag_error (self );
394396 Py_DECREF (n );
395397 Py_DECREF (v );
398+ Py_DECREF (container );
396399 return ;
397400 }
398401 else {
@@ -401,12 +404,14 @@ my_StartElementHandler(void *userData,
401404 }
402405 }
403406 args = string_intern (self , name );
404- if (args != NULL )
405- args = Py_BuildValue ("(NN)" , args , container );
406407 if (args == NULL ) {
407408 Py_DECREF (container );
408409 return ;
409410 }
411+ args = Py_BuildValue ("(NN)" , args , container );
412+ if (args == NULL ) {
413+ return ;
414+ }
410415 /* Container is now a borrowed reference; ignore it. */
411416 self -> in_callback = 1 ;
412417 rv = call_with_frame ("StartElement" , __LINE__ ,
@@ -565,7 +570,6 @@ my_ElementDeclHandler(void *userData,
565570 }
566571 args = Py_BuildValue ("NN" , nameobj , modelobj );
567572 if (args == NULL ) {
568- Py_DECREF (modelobj );
569573 flag_error (self );
570574 goto finally ;
571575 }
You can’t perform that action at this time.
0 commit comments