提交 f2160eb1 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix potential leak of output memory when size == 1.

上级 bf0df19f
...@@ -87,6 +87,7 @@ int APPLY_SPECIFIC(dnn_redux)(PyGpuArrayObject *input, ...@@ -87,6 +87,7 @@ int APPLY_SPECIFIC(dnn_redux)(PyGpuArrayObject *input,
} }
if (p == input->ga.nd || rsz == 1) { if (p == input->ga.nd || rsz == 1) {
Py_XDECREF(*output);
*output = pygpu_reshape(input, p, dims, GA_C_ORDER, 0, -1); *output = pygpu_reshape(input, p, dims, GA_C_ORDER, 0, -1);
if (*output == NULL) if (*output == NULL)
return 1; return 1;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论