Permalink
Browse files

Fix error report https://bugzilla.redhat.com/show_bug.cgi?id=800196

  • Loading branch information...
1 parent f26809f commit 3e000ca5fd892c15ef4338cda0ec1760bb08ed19 @jeremysanders jeremysanders committed Mar 19, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 helpers/src/_nc_cntr.c
View
@@ -1361,12 +1361,14 @@ build_cntr_list_p(long *np, double *xp, double *yp, int nparts, long ntotal)
int i, j, k;
all_contours = PyList_New(nparts);
+ if (all_contours == NULL) return NULL;
for (i = 0; i < nparts; i++)
{
start = end;
end += np[i];
contourList = PyList_New(np[i]);
+ if (contourList == NULL) goto error;
for (k = 0, j = start; j < end; j++, k++)
{
point = Py_BuildValue("(dd)", xp[j], yp[j]);
@@ -1430,6 +1432,7 @@ build_cntr_list_v2(long *np, double *xp, double *yp, int nparts, long ntotal)
long j, k;
all_contours = PyList_New(nparts);
+ if (all_contours == NULL) return NULL;
k = 0;
for (i = 0; i < nparts; i++)

0 comments on commit 3e000ca

Please sign in to comment.