diff options
author | Ján Tomko <jtomko@redhat.com> | 2019-10-20 13:49:46 +0200 |
---|---|---|
committer | Ján Tomko <jtomko@redhat.com> | 2019-10-21 12:51:59 +0200 |
commit | 29b1e859e31960fb3e923636f4e6d97c1b30f429 (patch) | |
tree | 9d952c2e0a17eb102e171fea1a3e0c502e456fa3 /tests/securityselinuxtest.c | |
parent | ddb99ca51661e4b6411998506a3c4957e686a1f6 (diff) | |
download | libvirt-29b1e859e31960fb3e923636f4e6d97c1b30f429.tar.gz |
tests: use g_strdup instead of VIR_STRDUP
Replace all occurrences of
if (VIR_STRDUP(a, b) < 0)
/* effectively dead code */
with:
a = g_strdup(b);
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Diffstat (limited to 'tests/securityselinuxtest.c')
-rw-r--r-- | tests/securityselinuxtest.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c index 5dccb708d8..6c8314de6b 100644 --- a/tests/securityselinuxtest.c +++ b/tests/securityselinuxtest.c @@ -77,17 +77,14 @@ testBuildDomainDef(bool dynamic, if (VIR_ALLOC(secdef) < 0) goto error; - if (VIR_STRDUP(secdef->model, "selinux") < 0) - goto error; + secdef->model = g_strdup("selinux"); secdef->type = dynamic ? VIR_DOMAIN_SECLABEL_DYNAMIC : VIR_DOMAIN_SECLABEL_STATIC; - if (label && - VIR_STRDUP(secdef->label, label) < 0) - goto error; + if (label) + secdef->label = g_strdup(label); - if (baselabel && - VIR_STRDUP(secdef->baselabel, baselabel) < 0) - goto error; + if (baselabel) + secdef->baselabel = g_strdup(baselabel); def->seclabels[0] = secdef; def->nseclabels++; |