diff options
author | Guido van Rossum <guido@python.org> | 1993-02-05 09:46:15 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-02-05 09:46:15 (GMT) |
commit | 6f5afc9a73d7388bf96df69323589f2f82c110ba (patch) | |
tree | f642f4a5f0d1a136b4480575460662deb89d7502 /Modules/svmodule.c | |
parent | 995c33a2bbb540729e3330ed8f11365e578ab5a0 (diff) | |
download | cpython-6f5afc9a73d7388bf96df69323589f2f82c110ba.zip cpython-6f5afc9a73d7388bf96df69323589f2f82c110ba.tar.gz cpython-6f5afc9a73d7388bf96df69323589f2f82c110ba.tar.bz2 |
* 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
Diffstat (limited to 'Modules/svmodule.c')
-rw-r--r-- | Modules/svmodule.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Modules/svmodule.c b/Modules/svmodule.c index 0d14473..bbdbf33 100644 --- a/Modules/svmodule.c +++ b/Modules/svmodule.c @@ -126,7 +126,7 @@ svc_GetFields(self, args) 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 @@ svc_GetFields(self, args) 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 * |