[libvirt] [PATCH 1/2] virSysinfoParseProcessor: Drop useless check for NULL

Eric Blake eblake at redhat.com
Tue May 12 17:44:57 UTC 2015


On 05/12/2015 10:23 AM, Michal Privoznik wrote:
> VIR_STRDUP plays nicely with NULLs. Theres no need to guard its
> call with check for non-NULL.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/util/virsysinfo.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

ACK

> 
> diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
> index 4edce66..8bb17f0 100644
> --- a/src/util/virsysinfo.c
> +++ b/src/util/virsysinfo.c
> @@ -315,8 +315,7 @@ virSysinfoParseProcessor(const char *base, virSysinfoDefPtr ret)
>                          cur, eol - cur) < 0)
>              goto error;
>  
> -        if (processor_type &&
> -            VIR_STRDUP(processor->processor_type, processor_type) < 0)
> +        if (VIR_STRDUP(processor->processor_type, processor_type) < 0)
>              goto error;
>  
>          base = cur;
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150512/507e9685/attachment-0001.sig>


More information about the libvir-list mailing list