summary refs log tree commit diff
path: root/libnm-core/nm-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-core/nm-utils.c')
-rw-r--r--libnm-core/nm-utils.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index 6ceef1e4..eebd73cf 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -2823,14 +2823,14 @@ static const NMVariantAttributeSpec *const tc_tfilter_attribute_spec[] = {
 NMTCTfilter *
 nm_utils_tc_tfilter_from_str(const char *str, GError **error)
 {
-    guint32            handle         = TC_H_UNSPEC;
-    guint32            parent         = TC_H_UNSPEC;
-    gs_free char *     kind           = NULL;
-    gs_free char *     rest           = NULL;
-    NMTCAction *       action         = NULL;
-    const char *       extra_opts     = NULL;
-    NMTCTfilter *      tfilter        = NULL;
-    gs_unref_hashtable GHashTable *ht = NULL;
+    guint32                 handle                 = TC_H_UNSPEC;
+    guint32                 parent                 = TC_H_UNSPEC;
+    gs_free char *          kind                   = NULL;
+    gs_free char *          rest                   = NULL;
+    nm_auto_unref_tc_action NMTCAction *action     = NULL;
+    const char *                        extra_opts = NULL;
+    NMTCTfilter *                       tfilter    = NULL;
+    gs_unref_hashtable GHashTable *ht              = NULL;
     GVariant *                     variant;
 
     nm_assert(str);
@@ -2870,10 +2870,8 @@ nm_utils_tc_tfilter_from_str(const char *str, GError **error)
         return NULL;
 
     nm_tc_tfilter_set_handle(tfilter, handle);
-    if (action) {
+    if (action)
         nm_tc_tfilter_set_action(tfilter, action);
-        nm_tc_action_unref(action);
-    }
 
     return tfilter;
 }