[gnome-calendar] source-dialog: remove useless checks before freeing memory
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] source-dialog: remove useless checks before freeing memory
- Date: Mon, 25 May 2015 17:02:20 +0000 (UTC)
commit 6213f5cc78d5c33d8b9b873e0d210c26261727f9
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed May 6 09:26:39 2015 -0300
source-dialog: remove useless checks before freeing memory
g_free is NULL-proof, no need to check if it's NULL
before using it.
src/gcal-source-dialog.c | 22 +++++++---------------
1 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 79ba54f..32d9a8a 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -399,10 +399,8 @@ calendar_listbox_sort_func (GtkListBoxRow *row1,
if (retval == 0)
retval = g_strcmp0 (e_source_get_display_name (source1), e_source_get_display_name (source2));
- if (parent_name1 != NULL)
- g_free (parent_name1);
- if (parent_name2 != NULL)
- g_free (parent_name2);
+ g_free (parent_name1);
+ g_free (parent_name2);
}
else
{
@@ -1370,21 +1368,16 @@ validate_url_cb (GcalSourceDialog *dialog)
dialog);
}
- if (user)
- g_free (user);
- if (password)
- g_free (password);
+ g_free (user);
+ g_free (password);
}
e_named_parameters_free (credentials);
}
out:
- if (host)
- g_free (host);
-
- if (path)
- g_free (path);
+ g_free (host);
+ g_free (path);
return FALSE;
}
@@ -1624,8 +1617,7 @@ discover_sources_cb (GObject *source,
gtk_widget_show_all (row);
}
- if (resource_path)
- g_free (resource_path);
+ g_free (resource_path);
}
// Free things up
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]