提交 d715bfac 编写于 作者: M Michal Privoznik

admin_server: Avoid accessing unallocated memory

In 68b726b9 we tried to fix a mem leak. However, it
wasn't done quite well. Problem is, virNetDaemonGetServers() may
fail in which case virObjectListFreeCount() would be called with
-1 objects to free. But the number of elements is taken in
unsigned rather than signed integer.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 3e5b35a5
......@@ -54,7 +54,8 @@ adminConnectListServers(virNetDaemonPtr dmn,
srvs = NULL;
}
cleanup:
virObjectListFreeCount(srvs, ret);
if (ret > 0)
virObjectListFreeCount(srvs, ret);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册