mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
conf: handle null pointer in virNetDevVlanFormat
Other *Format() functions (e.g. virNetDevBandwidthFormat()) return with no action when called with a NULL *Def pointer. This makes virNetDevVlanFormat() consistent with that behavior.
This commit is contained in:
parent
6d4ffae4fc
commit
79358733b0
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2009-2013 Red Hat, Inc.
|
* Copyright (C) 2009-2014 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -144,7 +144,7 @@ virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf)
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (def->nTags == 0)
|
if (!(def && def->nTags))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!def->tag) {
|
if (!def->tag) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user