提交 361e46d6 编写于 作者: J Jim Meyering

xs_internal.c: don't use a negative value as allocation size

* src/xen/xs_internal.c (xenStoreDomainIntroduced): Don't use -1
as an allocation size upon xenStoreNumOfDomains failure.
(xenStoreDomainReleased): Likewise.
上级 9120f004
/*
* xs_internal.c: access to Xen Store
*
* Copyright (C) 2006, 2009 Red Hat, Inc.
* Copyright (C) 2006, 2009-2010 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
......@@ -1367,6 +1367,9 @@ int xenStoreDomainIntroduced(virConnectPtr conn,
retry:
new_domain_cnt = xenStoreNumOfDomains(conn);
if (new_domain_cnt < 0)
return -1;
if( VIR_ALLOC_N(new_domids,new_domain_cnt) < 0 ) {
virReportOOMError(NULL);
return -1;
......@@ -1447,6 +1450,8 @@ int xenStoreDomainReleased(virConnectPtr conn,
retry:
new_domain_cnt = xenStoreNumOfDomains(conn);
if (new_domain_cnt < 0)
return -1;
if( VIR_ALLOC_N(new_domids,new_domain_cnt) < 0 ) {
virReportOOMError(NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册