diff Modules/svmodule.c @ 1207:b564bd4e57e1 legacy-trunk

* ceval.c: ifdef out the last argument passing compat hack. * Fixed memory leaks in socket, select and sv modules: mkvalue("O", v) does INCREF(v) so if v is brand new it should be XDECREF'd
author Guido van Rossum <guido@python.org>
date Fri, 05 Feb 1993 09:46:15 +0000
parents 2937897a7d8b
children 685b31fe89c6
line wrap: on
line diff
--- a/Modules/svmodule.c	Fri Feb 05 09:39:16 1993 +0000
+++ b/Modules/svmodule.c	Fri Feb 05 09:46:15 1993 +0000
@@ -126,7 +126,7 @@
 	captureobject *self;
 	object *args;
 {
-	object *f1, *f2;
+	object *f1, *f2, *ret;
 	int fieldsize;
 
 	if (self->ob_info.format != SV_RGB8_FRAMES) {
@@ -136,14 +136,11 @@
 
 	fieldsize = self->ob_info.width * self->ob_info.height / 2;
 	f1 = newsizedstringobject((char *) self->ob_capture, fieldsize);
-	if (f1 == NULL)
-		return NULL;
 	f2 = newsizedstringobject((char *) self->ob_capture + fieldsize, fieldsize);
-	if (f2 == NULL) {
-		DECREF(f1);
-		return NULL;
-	}
-	return mkvalue("(OO)", f1, f2);
+	ret = mkvalue("(OO)", f1, f2);
+	XDECREF(f1);
+	XDECREF(f2);
+	return ret;
 }
 	
 static object *