Patchwork [6,of,6,lazymanifest-errors] lazymanifest: check error return in filter

login
register
mail settings
Submitter Augie Fackler
Date Dec. 31, 2015, 7:05 p.m.
Message ID <1c998c01fb5e0ad5e1e1.1451588750@imladris.local>
Download mbox | patch
Permalink /patch/12454/
State Accepted
Headers show

Comments

Augie Fackler - Dec. 31, 2015, 7:05 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1451587548 18000
#      Thu Dec 31 13:45:48 2015 -0500
# Node ID 1c998c01fb5e0ad5e1e1331a3e81bd79532e01fc
# Parent  35ef7322aa717f45336e4441c9458d9a08862370
lazymanifest: check error return in filter
Bryan O'Sullivan - Jan. 1, 2016, 10:51 p.m.
On Thu, Dec 31, 2015 at 11:05 AM, Augie Fackler <raf@durin42.com> wrote:

> lazymanifest: check error return in filter
>

Looks good :-)

Patch

diff --git a/mercurial/manifest.c b/mercurial/manifest.c
--- a/mercurial/manifest.c
+++ b/mercurial/manifest.c
@@ -712,6 +712,9 @@  static lazymanifest *lazymanifest_filter
 		goto nomem;
 	}
 	copy = PyObject_New(lazymanifest, &lazymanifestType);
+	if (!copy) {
+		goto nomem;
+	}
 	copy->dirty = true;
 	copy->lines = malloc(self->maxlines * sizeof(line));
 	if (!copy->lines) {