From 8e3c3a5eda7817b012423b3faae788b369119834 Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Sun, 4 Dec 2011 11:56:39 -0200 Subject: Remove all usages of if (ptr) free(ptr) since free() already performs null-checks. --- shell/report.c | 6 ++---- shell/syncmanager.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'shell') diff --git a/shell/report.c b/shell/report.c index fb87ee23..fb18c346 100644 --- a/shell/report.c +++ b/shell/report.c @@ -226,8 +226,7 @@ void report_table(ReportContext * ctx, gchar * text) static void report_html_header(ReportContext * ctx) { - if (ctx->output) - g_free(ctx->output); + g_free(ctx->output); ctx->output = g_strdup_printf @@ -318,8 +317,7 @@ report_html_key_value(ReportContext * ctx, gchar * key, gchar * value) static void report_text_header(ReportContext * ctx) { - if (ctx->output) - g_free(ctx->output); + g_free(ctx->output); ctx->output = g_strdup(""); } diff --git a/shell/syncmanager.c b/shell/syncmanager.c index 496dc348..ce50d429 100644 --- a/shell/syncmanager.c +++ b/shell/syncmanager.c @@ -326,14 +326,12 @@ static gboolean _action_call_function(SyncDialog * sd, gpointer user_data) VERSION, ARCH, sna->entry->name, str_data, NULL)) { - if (str_data) - g_free(str_data); + g_free(str_data); return FALSE; } - if (str_data) - g_free(str_data); + g_free(str_data); } return sna->error ? FALSE : TRUE; -- cgit v1.2.3