Commit e8e6eed0 authored by liujisi@google.com's avatar liujisi@google.com

Fixed a memory leak in python CPP implementation.

parent 7a6de000
......@@ -1100,9 +1100,11 @@ static PyObject* CMessage_AssignRepeatedScalar(CMessage* self, PyObject* args) {
while ((next = PyIter_Next(iter)) != NULL) {
if (InternalAddRepeatedScalar(
message, cfield_descriptor->descriptor, next) == NULL) {
Py_DECREF(next);
Py_DECREF(iter);
return NULL;
}
Py_DECREF(next);
}
Py_DECREF(iter);
Py_RETURN_NONE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment