Fixed a memory leak in python CPP implementation.
This commit is contained in:
parent
7a6de0008a
commit
e8e6eed0be
1 changed files with 3 additions and 1 deletions
|
@ -1099,10 +1099,12 @@ static PyObject* CMessage_AssignRepeatedScalar(CMessage* self, PyObject* args) {
|
|||
PyObject* next;
|
||||
while ((next = PyIter_Next(iter)) != NULL) {
|
||||
if (InternalAddRepeatedScalar(
|
||||
message, cfield_descriptor->descriptor, next) == NULL) {
|
||||
message, cfield_descriptor->descriptor, next) == NULL) {
|
||||
Py_DECREF(next);
|
||||
Py_DECREF(iter);
|
||||
return NULL;
|
||||
}
|
||||
Py_DECREF(next);
|
||||
}
|
||||
Py_DECREF(iter);
|
||||
Py_RETURN_NONE;
|
||||
|
|
Loading…
Add table
Reference in a new issue