summaryrefslogtreecommitdiff
path: root/libnm-core
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2018-10-04 09:36:11 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2018-10-06 10:03:48 +0200
commit27ab932a499e300b966ef387d9ed4cac4d3b2b4c (patch)
tree2701c97abe90ba86a7692b8b43ff484df6abfa85 /libnm-core
parent9b04b871a0ff2b510f504d12558e7f1de8bb2f74 (diff)
libnm-core: use g_variant_type_equal() to compare variant types
Even if a direct pointer comparison should be fine, use the proper function. GVariantType documentation says: "Two types may not be compared by value; use g_variant_type_equal() or g_variant_type_is_subtype_of()." This also fixes coverity warnings.
Diffstat (limited to 'libnm-core')
-rw-r--r--libnm-core/nm-setting-ip-config.c2
-rw-r--r--libnm-core/nm-setting-sriov.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c
index fa2535b8f..2b3134b66 100644
--- a/libnm-core/nm-setting-ip-config.c
+++ b/libnm-core/nm-setting-ip-config.c
@@ -1310,7 +1310,7 @@ nm_ip_route_attribute_validate (const char *name,
return FALSE;
}
- if (spec->type == G_VARIANT_TYPE_STRING) {
+ if (g_variant_type_equal (spec->type, G_VARIANT_TYPE_STRING)) {
const char *string = g_variant_get_string (value, NULL);
gs_free char *string_free = NULL;
char *sep;
diff --git a/libnm-core/nm-setting-sriov.c b/libnm-core/nm-setting-sriov.c
index d23277a02..39b872a22 100644
--- a/libnm-core/nm-setting-sriov.c
+++ b/libnm-core/nm-setting-sriov.c
@@ -433,7 +433,7 @@ nm_sriov_vf_attribute_validate (const char *name,
return FALSE;
}
- if (spec->type == G_VARIANT_TYPE_STRING) {
+ if (g_variant_type_equal (spec->type, G_VARIANT_TYPE_STRING)) {
const char *string;
switch (spec->str_type) {