[Python-bugs-list] [ python-Bugs-626275 ] missing DECREF's in embedding example

noreply@sourceforge.net noreply@sourceforge.net
Mon, 21 Oct 2002 03:30:57 -0700


Bugs item #626275, was opened at 2002-10-21 12:30
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=626275&group_id=5470

Category: Documentation
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Gernot Hillier (yoda_gh)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: missing DECREF's in embedding example

Initial Comment:
Extending and Embedding Python, chapter 5.3 Pure Embedding 
 
There's a large example. 
 
I think there are some Py_DECREF's missing in the error handling 
cases: 
 
else { 
	PyErr_Print(); 
	fprintf(stderr, "Call failed\n"); 
	return 1; 
} 
 
--> this one misses IMHO 
Py_DECREF(pArgs); 
Py_DECREF(pModule); 
Py_DECREF(pName); 
 
else { 
	PyErr_Print(); 
	fprintf(stderr, "Failed to load \%s\\n", argv[1]); 
	return 1; 
} 
 
--> this one misses IMHO 
Py_DECREF(pName); 
 
I'm no Python expert, so I may be wrong - please check! 
 
If they're not necessary in these cases, you should perhaps add a 
comment explaining the reason to the docs... 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=626275&group_id=5470