comparison mercurial/manifest.c @ 27661:abc79f44f548

lazymanifest: check more return values in filtercopy Spotted by Bryan O'Sullivan (and vexingly not the static analyzer I've been using.)
author Augie Fackler <raf@durin42.com>
date Thu, 31 Dec 2015 13:31:42 -0500
parents ca2d4080a02e
children c5912a0b156c
comparison
equal deleted inserted replaced
27660:512f883c234c 27661:abc79f44f548
705 copy->maxlines = self->maxlines; 705 copy->maxlines = self->maxlines;
706 copy->numlines = 0; 706 copy->numlines = 0;
707 copy->pydata = self->pydata; 707 copy->pydata = self->pydata;
708 Py_INCREF(self->pydata); 708 Py_INCREF(self->pydata);
709 for (i = 0; i < self->numlines; i++) { 709 for (i = 0; i < self->numlines; i++) {
710 PyObject *arg = PyString_FromString(self->lines[i].start); 710 PyObject *arglist = NULL, *result = NULL;
711 PyObject *arglist = PyTuple_Pack(1, arg); 711 arglist = Py_BuildValue("(s)", self->lines[i].start);
712 PyObject *result = PyObject_CallObject(matchfn, arglist); 712 if (!arglist) {
713 return NULL;
714 }
715 result = PyObject_CallObject(matchfn, arglist);
713 Py_DECREF(arglist); 716 Py_DECREF(arglist);
714 Py_DECREF(arg);
715 /* if the callback raised an exception, just let it 717 /* if the callback raised an exception, just let it
716 * through and give up */ 718 * through and give up */
717 if (!result) { 719 if (!result) {
718 free(copy->lines); 720 free(copy->lines);
719 Py_DECREF(self->pydata); 721 Py_DECREF(self->pydata);