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