提交 27a63a76 编写于 作者: D Daniel Veillard

* src/xend_internal.c: fix an allocation problem in xenDaemonDomainLookupByName_ids

Daniel
上级 4dfb7e8b
Tue Mar 10 12:03:37 CET 2009 Daniel Veillard <veilard@redhat.com>
* src/xend_internal.c: fix an allocation problem in
xenDaemonDomainLookupByName_ids
Tue Mar 10 10:29:46 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
* src/xend_internal.c: Fix tap vs vbd type for block detach
......
......@@ -904,7 +904,15 @@ xenDaemonListDomainsOld(virConnectPtr xend)
count++;
}
if (VIR_ALLOC_N(ptr, count + 1 + extra) < 0)
/*
* We can'tuse the normal allocation routines as we are mixing
* an array of char * at the beginning followed by an array of char
* ret points to the NULL terminated array of char *
* ptr points to the current string after that array but in the same
* allocated block
*/
if (virAlloc((void *)&ptr,
(count + 1) * sizeof(char *) + extra * sizeof(char)) < 0)
goto error;
ret = (char **) ptr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册