Skip to content

Commit

Permalink
Fixed reference counting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
martinandersen committed Dec 7, 2016
1 parent 15bfe65 commit f36edb4
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/C/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ static PyObject* sdpa_readhead
#endif
FILE *fp = fopen(fname,"r");
if (!fp) {
Py_DECREF(f);
return NULL;
}
/* Skip comments and read m */
Expand All @@ -101,7 +100,6 @@ static PyObject* sdpa_readhead
n += (int_t) labs(MAT_BUFI(bstruct)[i]);
}
fclose(fp);
Py_DECREF(f);
}

return Py_BuildValue("iiN",n,m,bstruct);
Expand Down Expand Up @@ -166,7 +164,6 @@ static PyObject* sdpa_read
#endif
FILE *fp = fopen(fname,"r");
if (!fp) {
Py_DECREF(f);
return NULL;
}
/* Skip comments and read m */
Expand Down Expand Up @@ -248,7 +245,6 @@ static PyObject* sdpa_read
while (m+1 > j)
SP_COL(A)[++j] = i;

Py_DECREF(f);
fclose(fp);

// free temp. memory
Expand Down

0 comments on commit f36edb4

Please sign in to comment.