Skip to content

Commit 8a66f03

Browse files
committed
Fix missing free for some abnormal cases
1 parent 2576f73 commit 8a66f03

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/gstype_python.i

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,13 +1871,15 @@ static bool getRowFields(GSRow* row, int columnCount, GSType* typeList, bool tim
18711871
if (!PyList_Check(rowTmp)) {
18721872
PyErr_SetString(PyExc_ValueError, "Expected a List");
18731873
delete containerInfoTmp;
1874+
delete tmpContainer;
18741875
SWIG_fail;
18751876
}
18761877
length = (int)PyInt_AsLong(PyLong_FromSsize_t(PyList_Size(rowTmp)));
18771878
GSResult ret = gsCreateRowByContainer(tmpContainer->getGSContainerPtr(), &$1[i][j]);
18781879
if ($1[i][j] == NULL || ret != GS_RESULT_OK) {
18791880
PyErr_SetString(PyExc_ValueError, "Memory allocation error");
18801881
delete containerInfoTmp;
1882+
delete tmpContainer;
18811883
SWIG_fail;
18821884
}
18831885
for (int k = 0; k < length; k++) {
@@ -1886,6 +1888,7 @@ static bool getRowFields(GSRow* row, int columnCount, GSType* typeList, bool tim
18861888
sprintf(gsType, "Invalid value for column %d, type should be : %d", k, typeArr[k]);
18871889
PyErr_SetString(PyExc_ValueError, gsType);
18881890
delete containerInfoTmp;
1891+
delete tmpContainer;
18891892
SWIG_fail;
18901893
}
18911894
}

0 commit comments

Comments
 (0)