Skip to content

Commit 15832c8

Browse files
authored
Merge pull request #4043 from clumens/update_null
Refactor: Don't use pcmk__str_update to set a string to NULL.
2 parents f0cc131 + 94f7585 commit 15832c8

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

daemons/attrd/attrd_cib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2025 the Pacemaker project contributors
2+
* Copyright 2013-2026 the Pacemaker project contributors
33
*
44
* The version control history for this file may have further details.
55
*
@@ -292,7 +292,7 @@ attrd_cib_callback(xmlNode *msg, int call_id, int rc, xmlNode *output, void *use
292292
if (rc == pcmk_ok) {
293293
pcmk__info("* Wrote %s[%s]=%s", a->id, peer,
294294
pcmk__s(v->requested, "(unset)"));
295-
pcmk__str_update(&(v->requested), NULL);
295+
g_clear_pointer(&v->requested, free);
296296
} else {
297297
do_crm_log(level, "* Could not write %s[%s]=%s",
298298
a->id, peer, pcmk__s(v->requested, "(unset)"));

daemons/execd/cts-exec-helper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2025 the Pacemaker project contributors
2+
* Copyright 2012-2026 the Pacemaker project contributors
33
*
44
* The version control history for this file may have further details.
55
*
@@ -81,8 +81,8 @@ param_key_val_cb(const gchar *option_name, const gchar *optarg, gpointer data, G
8181

8282
if (key != NULL && val != NULL) {
8383
options.params = lrmd_key_value_add(options.params, key, val);
84-
pcmk__str_update(&key, NULL);
85-
pcmk__str_update(&val, NULL);
84+
g_clear_pointer(&key, free);
85+
g_clear_pointer(&val, free);
8686
}
8787

8888
return TRUE;

tools/crm_attribute.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2004-2025 the Pacemaker project contributors
2+
* Copyright 2004-2026 the Pacemaker project contributors
33
*
44
* The version control history for this file may have further details.
55
*
@@ -90,7 +90,7 @@ list_cb(const gchar *option_name, const gchar *optarg, gpointer data,
9090
static gboolean
9191
delete_cb(const gchar *option_name, const gchar *optarg, gpointer data, GError **error) {
9292
options.command = attr_cmd_delete;
93-
pcmk__str_update(&options.attr_value, NULL);
93+
g_clear_pointer(&options.attr_value, free);
9494
return TRUE;
9595
}
9696

@@ -149,7 +149,7 @@ utilization_cb(const gchar *option_name, const gchar *optarg, gpointer data, GEr
149149
static gboolean
150150
value_cb(const gchar *option_name, const gchar *optarg, gpointer data, GError **error) {
151151
options.command = attr_cmd_query;
152-
pcmk__str_update(&options.attr_value, NULL);
152+
g_clear_pointer(&options.attr_value, free);
153153
return TRUE;
154154
}
155155

tools/crm_ticket.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2025 the Pacemaker project contributors
2+
* Copyright 2012-2026 the Pacemaker project contributors
33
*
44
* The version control history for this file may have further details.
55
*
@@ -78,8 +78,8 @@ attr_value_cb(const gchar *option_name, const gchar *optarg, gpointer data, GErr
7878
}
7979

8080
pcmk__insert_dup(attr_set, options.attr_name, options.attr_value);
81-
pcmk__str_update(&options.attr_name, NULL);
82-
pcmk__str_update(&options.attr_value, NULL);
81+
g_clear_pointer(&options.attr_name, free);
82+
g_clear_pointer(&options.attr_value, free);
8383

8484
modified = true;
8585

@@ -147,8 +147,8 @@ set_attr_cb(const gchar *option_name, const gchar *optarg, gpointer data, GError
147147
}
148148

149149
pcmk__insert_dup(attr_set, options.attr_name, options.attr_value);
150-
pcmk__str_update(&options.attr_name, NULL);
151-
pcmk__str_update(&options.attr_value, NULL);
150+
g_clear_pointer(&options.attr_name, free);
151+
g_clear_pointer(&options.attr_value, free);
152152

153153
modified = true;
154154

0 commit comments

Comments
 (0)