Replace free(val); val=NULL; with g_clear_pointer
This commit is contained in:
parent
ae370e7289
commit
e4b0aae05a
@ -289,8 +289,7 @@ static notification *dbus_message_to_notification(const gchar *sender, GVariant
|
||||
n->transient = transient;
|
||||
|
||||
if (actions->count < 1) {
|
||||
actions_free(actions);
|
||||
actions = NULL;
|
||||
g_clear_pointer(&actions, actions_free);
|
||||
}
|
||||
n->actions = actions;
|
||||
|
||||
@ -484,8 +483,7 @@ static int dbus_get_fdn_daemon_info(GDBusConnection *connection,
|
||||
|
||||
if (error) {
|
||||
/* Ignore the error, we may still be able to retrieve the PID */
|
||||
g_error_free(error);
|
||||
error = NULL;
|
||||
g_clear_pointer(&error, g_error_free);
|
||||
} else {
|
||||
g_variant_get(daemoninfo, "(ssss)", name, vendor, NULL, NULL);
|
||||
}
|
||||
|
@ -66,9 +66,8 @@ void free_ini(void)
|
||||
g_free(sections[i].entries);
|
||||
g_free(sections[i].name);
|
||||
}
|
||||
g_free(sections);
|
||||
g_clear_pointer(§ions, g_free);
|
||||
section_count = 0;
|
||||
sections = NULL;
|
||||
}
|
||||
|
||||
section_t *get_section(const char *name)
|
||||
|
@ -27,8 +27,7 @@ void rule_apply(rule_t *r, notification *n)
|
||||
if (r->new_icon) {
|
||||
g_free(n->icon);
|
||||
n->icon = g_strdup(r->new_icon);
|
||||
rawimage_free(n->raw_icon);
|
||||
n->raw_icon = NULL;
|
||||
g_clear_pointer(&n->raw_icon, rawimage_free);
|
||||
}
|
||||
if (r->fg) {
|
||||
g_free(n->colors[ColFG]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user