Re: [PATCH v3 22/34] Adapt to VIR_STRDUP and VIR_STRNDUP in src/storage/*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/03/2013 04:53 PM, Michal Privoznik wrote:
> ---
>  src/storage/parthelper.c               |  5 ++---
>  src/storage/storage_backend.c          | 22 ++++++----------------
>  src/storage/storage_backend_disk.c     | 26 +++++++-------------------
>  src/storage/storage_backend_fs.c       | 34 ++++++++++------------------------
>  src/storage/storage_backend_iscsi.c    | 17 ++++-------------
>  src/storage/storage_backend_logical.c  | 32 ++++++++++----------------------
>  src/storage/storage_backend_mpath.c    |  5 +----
>  src/storage/storage_backend_rbd.c      |  5 ++---
>  src/storage/storage_backend_scsi.c     | 19 +++++++------------
>  src/storage/storage_backend_sheepdog.c |  6 +-----
>  src/storage/storage_driver.c           | 18 ++++++------------
>  11 files changed, 56 insertions(+), 133 deletions(-)
> 

> diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
> index 316043f..aceb650 100644
> --- a/src/storage/storage_backend_logical.c
> +++ b/src/storage/storage_backend_logical.c
> @@ -358,13 +350,9 @@ virStorageBackendLogicalFindPoolSourcesFunc(virStoragePoolObjPtr pool ATTRIBUTE_
>      virStoragePoolSourceDevicePtr dev;
>      virStoragePoolSource *thisSource;
>  
> -    pvname = strdup(groups[0]);
> -    vgname = strdup(groups[1]);
> -
> -    if (pvname == NULL || vgname == NULL) {
> -        virReportOOMError();
> +    if (VIR_STRDUP(pvname, groups[0]) < 0 ||
> +        VIR_STRDUP(vgname, groups[1]) < 0)
>          goto err_no_memory;

err_no_memory should be renamed to error. But that's pre-existing.

> -    }
>  
>      thisSource = NULL;
>      for (i = 0 ; i < sourceList->nsources; i++) {

ACK

Jan

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]