未验证 提交 e1a34bc4 编写于 作者: Y YuanRisheng 提交者: GitHub

fix bugs (#43294)

上级 10f8637c
...@@ -734,12 +734,15 @@ PyObject* ToPyObject( ...@@ -734,12 +734,15 @@ PyObject* ToPyObject(
PADDLE_THROW( PADDLE_THROW(
platform::errors::Fatal("Unable to append string to py_list")); platform::errors::Fatal("Unable to append string to py_list"));
} }
Py_DECREF(val_string);
} }
if (PyDict_SetItem(dict, key_string, py_list) != 0) { if (PyDict_SetItem(dict, key_string, py_list) != 0) {
PADDLE_THROW( PADDLE_THROW(
platform::errors::Fatal("Unable to set key:value for py_dict")); platform::errors::Fatal("Unable to set key:value for py_dict"));
} }
Py_DECREF(py_list);
Py_DECREF(key_string);
} }
return dict; return dict;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册