mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-07 08:40:59 +00:00
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.
This commit is contained in:
parent
9b04b871a0
commit
27ab932a49
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue