Patchwork [4,of,4] parsers: add a missed PyErr_NoMemory

login
register
mail settings
Submitter Bryan O'Sullivan
Date Dec. 14, 2015, 6:49 p.m.
Message ID <2750cd9ef0c5670b96a6.1450118965@bryano-mbp.local>
Download mbox | patch
Permalink /patch/12035/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Bryan O'Sullivan - Dec. 14, 2015, 6:49 p.m.
# HG changeset patch
# User Bryan O'Sullivan <bos@serpentine.com>
# Date 1450118847 28800
#      Mon Dec 14 10:47:27 2015 -0800
# Node ID 2750cd9ef0c5670b96a6ddc27b2088218b9bca86
# Parent  c7cd7212c41596731c246ebc8d006a76e437fa5c
parsers: add a missed PyErr_NoMemory

Patch

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -1407,8 +1407,10 @@  static PyObject *index_headrevs(indexObj
 	}
 
 	nothead = calloc(len, 1);
-	if (nothead == NULL)
+	if (nothead == NULL) {
+		PyErr_NoMemory();
 		goto bail;
+	}
 
 	for (i = 0; i < len; i++) {
 		int isfiltered;