diff --git a/src/notification.c b/src/notification.c index abcb19d..16bd9a6 100644 --- a/src/notification.c +++ b/src/notification.c @@ -176,12 +176,8 @@ void notification_free(notification *n) g_free(n->msg); g_free(n->dbus_client); g_free(n->category); - - if (n->text_to_render) - g_free(n->text_to_render); - - if (n->urls) - g_free(n->urls); + g_free(n->text_to_render); + g_free(n->urls); if (n->actions) { g_strfreev(n->actions->actions); @@ -642,10 +638,8 @@ bool notification_replace_by_id(notification *new) void notification_update_text_to_render(notification *n) { - if (n->text_to_render) { - g_free(n->text_to_render); - n->text_to_render = NULL; - } + g_free(n->text_to_render); + n->text_to_render = NULL; char *buf = NULL; diff --git a/src/option_parser.c b/src/option_parser.c index da85ec5..a8d522f 100644 --- a/src/option_parser.c +++ b/src/option_parser.c @@ -248,8 +248,7 @@ int load_ini_file(FILE *fp) *end = '\0'; - if (current_section) - g_free(current_section); + g_free(current_section); current_section = (g_strdup(start + 1)); new_section(current_section); continue; @@ -296,8 +295,7 @@ int load_ini_file(FILE *fp) add_entry(current_section, key, value); } free(line); - if (current_section) - g_free(current_section); + g_free(current_section); return 0; } diff --git a/src/rules.c b/src/rules.c index ebaae8d..fa30c7c 100644 --- a/src/rules.c +++ b/src/rules.c @@ -23,8 +23,7 @@ void rule_apply(rule_t *r, notification *n) if (r->markup != MARKUP_NULL) n->markup = r->markup; if (r->new_icon) { - if(n->icon) - g_free(n->icon); + g_free(n->icon); n->icon = g_strdup(r->new_icon); n->icon_overridden = true; } diff --git a/src/settings.c b/src/settings.c index b10ff9c..4a291bc 100644 --- a/src/settings.c +++ b/src/settings.c @@ -64,8 +64,7 @@ static int ini_get_urgency(const char *section, const char *key, const int def) "unknown urgency: %s, ignoring\n", urg); } - if (urg) - g_free(urg); + g_free(urg); return ret; }