mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
nwfilter: use g_auto() for all virBuffers
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
817519e900
commit
5f0f8f6c5d
@ -190,7 +190,7 @@ _printDataType(virNWFilterVarCombIterPtr vars,
|
||||
bool done;
|
||||
char *data;
|
||||
uint8_t ctr;
|
||||
virBuffer vb = VIR_BUFFER_INITIALIZER;
|
||||
g_auto(virBuffer) vb = VIR_BUFFER_INITIALIZER;
|
||||
char *flags;
|
||||
|
||||
if (printVar(vars, buf, bufsize, item, &done) < 0)
|
||||
@ -1528,7 +1528,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw,
|
||||
static int
|
||||
printStateMatchFlags(int32_t flags, char **bufptr)
|
||||
{
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
virNWFilterPrintStateMatchFlags(&buf,
|
||||
"",
|
||||
flags,
|
||||
@ -1798,7 +1798,7 @@ ebtablesCreateRuleInstance(virFirewallPtr fw,
|
||||
bool hasMask = false;
|
||||
virFirewallRulePtr fwrule;
|
||||
int ret = -1;
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
if (STREQ(chainSuffix,
|
||||
virNWFilterChainSuffixTypeToString(
|
||||
@ -2423,8 +2423,6 @@ ebtablesCreateRuleInstance(virFirewallPtr fw,
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virBufferFreeAndReset(&buf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -426,15 +426,13 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
|
||||
if (!virNWFilterVarAccessIsAvailable(rule->varAccess[j],
|
||||
vars)) {
|
||||
char *varAccess;
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
virNWFilterVarAccessPrint(rule->varAccess[j], &buf);
|
||||
|
||||
val = virNWFilterVarValueCreateSimpleCopyValue("1");
|
||||
if (!val) {
|
||||
virBufferFreeAndReset(&buf);
|
||||
if (!val)
|
||||
return -1;
|
||||
}
|
||||
|
||||
varAccess = virBufferContentAndReset(&buf);
|
||||
rc = virHashUpdateEntry(missing_vars, varAccess, val);
|
||||
|
@ -397,7 +397,7 @@ learnIPAddressThread(void *arg)
|
||||
req->binding->portdevname);
|
||||
int dhcp_opts_len;
|
||||
char macaddr[VIR_MAC_STRING_BUFLEN];
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
char *filter = NULL;
|
||||
uint16_t etherType;
|
||||
bool showError = true;
|
||||
|
Loading…
Reference in New Issue
Block a user