summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2022-07-29 00:03:26 +0200
committerLubomir Rintel <lkundrak@v3.sk>2022-07-29 00:07:57 +0200
commit64f13ee7ca28ce2955465efdc6e354502c9667ad (patch)
treedc2275396ac5b77a37d4813020de9a36efd0bd9a
parent8bdf7eb9a9861d1f63b34c08df11c9d94e5307b7 (diff)
nmcli: move an assignment down to where the value neededlr/nmcli-act-con-assert
It's happier there. No change in behavior.
-rw-r--r--src/nmcli/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nmcli/common.c b/src/nmcli/common.c
index e6c5c9a0b3..ff4c15c37e 100644
--- a/src/nmcli/common.c
+++ b/src/nmcli/common.c
@@ -539,8 +539,6 @@ nmc_find_active_connection(const GPtrArray *active_cons,
NMActiveConnection *candidate = g_ptr_array_index(active_cons, i);
const char *v, *v_num;
- con = nm_active_connection_get_connection(candidate);
-
/* When filter_type is NULL, compare connection ID (filter_val)
* against all types. Otherwise, only compare against the specific
* type. If 'path' or 'apath' filter types are specified, comparison
@@ -562,6 +560,8 @@ nmc_find_active_connection(const GPtrArray *active_cons,
goto found;
}
+ con = nm_active_connection_get_connection(candidate);
+
if (NM_IN_STRSET(filter_type, NULL, "path")) {
v = con ? nm_connection_get_path(NM_CONNECTION(con)) : NULL;
v_num = nm_utils_dbus_path_get_last_component(v);