summaryrefslogtreecommitdiff
path: root/src/settings/plugins
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-03-23 11:00:43 +0100
committerThomas Haller <thaller@redhat.com>2020-03-23 11:05:34 +0100
commit073994ca4284a5e99314195981aa254f06c3bf69 (patch)
tree7d935de27616ff67fbedb141e2ee3152282dbfe2 /src/settings/plugins
parentc50b4621d4415f9156e969a6a05fb37e1bb02e18 (diff)
downloadNetworkManager-073994ca4284a5e99314195981aa254f06c3bf69.tar.gz
all: use nm_clear_g_free() instead of g_clear_pointer()
I think it's preferable to use nm_clear_g_free() instead of g_clear_pointer(, g_free). The reasons are not very strong, but I think it is overall preferable to have a shorthand for this frequently used functionality. sed 's/\<g_clear_pointer *(\([^;]*\), *\(g_free\) *)/nm_clear_g_free (\1)/g' $(git grep -l g_clear_pointer) -i
Diffstat (limited to 'src/settings/plugins')
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c2
-rw-r--r--src/settings/plugins/keyfile/nms-keyfile-writer.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
index ab73b153a0..d8da1aa356 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
@@ -4390,7 +4390,7 @@ parse_ethtool_option (const char *value,
i++;
if (nm_utils_hwaddr_valid (opt_val, ETH_ALEN)) {
- g_clear_pointer (out_password, g_free);
+ nm_clear_g_free (out_password);
*out_password = g_strdup (opt_val);
} else
PARSE_WARNING ("Wake-on-LAN password '%s' is invalid", opt_val);
diff --git a/src/settings/plugins/keyfile/nms-keyfile-writer.c b/src/settings/plugins/keyfile/nms-keyfile-writer.c
index 3a630c16f5..7554becc24 100644
--- a/src/settings/plugins/keyfile/nms-keyfile-writer.c
+++ b/src/settings/plugins/keyfile/nms-keyfile-writer.c
@@ -60,7 +60,7 @@ cert_writer (NMConnection *connection,
* that would be interpreted as legacy binary format by reader. */
tmp = nm_keyfile_detect_unqualified_path_scheme (info->keyfile_dir, p, -1, FALSE, NULL);
if (tmp) {
- g_clear_pointer (&tmp, g_free);
+ nm_clear_g_free (&tmp);
accepted_path = p;
}
}
@@ -71,7 +71,7 @@ cert_writer (NMConnection *connection,
* Otherwise, add a file:// prefix */
tmp = nm_keyfile_detect_unqualified_path_scheme (info->keyfile_dir, path, -1, FALSE, NULL);
if (tmp) {
- g_clear_pointer (&tmp, g_free);
+ nm_clear_g_free (&tmp);
accepted_path = path;
}
}