Mercurial > hg
diff mercurial/parsers.c @ 26007:1ebf4ac07582
reachableroots: if allocating a new set fails, use PyErr_NoMemory()
My inspection of the implementation of PySet_New() indicates that it
does *not* reliably set an exception in the cases where it returns
NULL (as far as I can tell it'll never do that!), so let's set that up
ourselves.
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 11 Aug 2015 14:49:40 -0400 |
parents | ff89383a97db |
children | 59d57ea69ae6 |
line wrap: on
line diff
--- a/mercurial/parsers.c Thu Aug 06 22:11:20 2015 -0700 +++ b/mercurial/parsers.c Tue Aug 11 14:49:40 2015 -0400 @@ -1143,8 +1143,10 @@ /* Initialize return set */ reachable = PySet_New(0); - if (reachable == NULL) + if (reachable == NULL) { + PyErr_NoMemory(); goto bail; + } /* Initialize internal datastructures */ tovisit = (int *)malloc((len + 1) * sizeof(int));