[Python-checkins] python/dist/src/Modules syslogmodule.c,2.19,2.20

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Dec 17 00:52:08 CET 2004


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9311
Modified Files:
	syslogmodule.c 
Log Message:
SF bug #1086555: refcount problem in syslog
Index: syslogmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/syslogmodule.c,v
retrieving revision 2.19
retrieving revision 2.20
diff -u -d -r2.19 -r2.20
--- syslogmodule.c	2 Aug 2002 02:27:13 -0000	2.19
+++ syslogmodule.c	16 Dec 2004 23:52:04 -0000	2.20
@@ -57,17 +57,18 @@
 {
 	long logopt = 0;
 	long facility = LOG_USER;
+	PyObject *new_S_ident_o;
 
-
-	Py_XDECREF(S_ident_o);
 	if (!PyArg_ParseTuple(args,
 			 "S|ll;ident string [, logoption [, facility]]",
-			 &S_ident_o, &logopt, &facility))
+			 &new_S_ident_o, &logopt, &facility))
 		return NULL;
 
 	/* This is needed because openlog() does NOT make a copy
 	 * and syslog() later uses it.. cannot trash it.
 	 */
+	Py_XDECREF(S_ident_o);
+	S_ident_o = new_S_ident_o;
 	Py_INCREF(S_ident_o);
 
 	openlog(PyString_AsString(S_ident_o), logopt, facility);


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /