##// END OF EJS Templates
parsers: correctly handle a failed allocation
Bryan O'Sullivan -
r19727:3d07b4a2 default
parent child Browse files
Show More
@@ -1212,14 +1212,19 b' static PyObject *find_gca_candidates(ind'
1212 1212 long sp;
1213 1213 bitmask *seen;
1214 1214
1215 if (gca == NULL)
1216 return PyErr_NoMemory();
1217
1215 1218 for (i = 0; i < revcount; i++) {
1216 1219 if (revs[i] > maxrev)
1217 1220 maxrev = revs[i];
1218 1221 }
1219 1222
1220 1223 seen = calloc(sizeof(*seen), maxrev + 1);
1221 if (seen == NULL)
1224 if (seen == NULL) {
1225 Py_DECREF(gca);
1222 1226 return PyErr_NoMemory();
1227 }
1223 1228
1224 1229 for (i = 0; i < revcount; i++)
1225 1230 seen[revs[i]] = 1ull << i;
General Comments 0
You need to be logged in to leave comments. Login now