mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00:00
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.
This commit is contained in:
parent
9120f00446
commit
361e46d6d0
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* xs_internal.c: access to Xen Store
|
* 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
|
* See COPYING.LIB for the License of this software
|
||||||
*
|
*
|
||||||
@ -1367,6 +1367,9 @@ int xenStoreDomainIntroduced(virConnectPtr conn,
|
|||||||
|
|
||||||
retry:
|
retry:
|
||||||
new_domain_cnt = xenStoreNumOfDomains(conn);
|
new_domain_cnt = xenStoreNumOfDomains(conn);
|
||||||
|
if (new_domain_cnt < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if( VIR_ALLOC_N(new_domids,new_domain_cnt) < 0 ) {
|
if( VIR_ALLOC_N(new_domids,new_domain_cnt) < 0 ) {
|
||||||
virReportOOMError(NULL);
|
virReportOOMError(NULL);
|
||||||
return -1;
|
return -1;
|
||||||
@ -1447,6 +1450,8 @@ int xenStoreDomainReleased(virConnectPtr conn,
|
|||||||
|
|
||||||
retry:
|
retry:
|
||||||
new_domain_cnt = xenStoreNumOfDomains(conn);
|
new_domain_cnt = xenStoreNumOfDomains(conn);
|
||||||
|
if (new_domain_cnt < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if( VIR_ALLOC_N(new_domids,new_domain_cnt) < 0 ) {
|
if( VIR_ALLOC_N(new_domids,new_domain_cnt) < 0 ) {
|
||||||
virReportOOMError(NULL);
|
virReportOOMError(NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user