From: Marek Kasik Date: Mon, 14 Jul 2014 13:37:06 +0000 (+0200) Subject: Remove redundant checks before free X-Git-Tag: 2.41.2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7c4c3bf5e3fdb5f95f92e881743ef8e7ad779f1;p=platform%2Fupstream%2Fglib.git Remove redundant checks before free Remove checks for NULL before g_free(). https://bugzilla.gnome.org/show_bug.cgi?id=733156 --- diff --git a/gio/fen/fen-kernel.c b/gio/fen/fen-kernel.c index a724f2f..8277fab 100644 --- a/gio/fen/fen-kernel.c +++ b/gio/fen/fen-kernel.c @@ -460,9 +460,7 @@ printevent (const char *pname, int event, const char *tag) static gchar *event_string = NULL; GString *str; - if (event_string) { - g_free(event_string); - } + g_free(event_string); str = g_string_new (""); g_string_printf (str, "[%s] [%-20s]", tag, pname); diff --git a/gio/gdbusintrospection.c b/gio/gdbusintrospection.c index 0c501c4..6d3ff93 100644 --- a/gio/gdbusintrospection.c +++ b/gio/gdbusintrospection.c @@ -1827,8 +1827,7 @@ g_dbus_node_info_new_for_xml (const gchar *xml_data, g_free (ughret); out: - if (parser != NULL) - g_free (parser); + g_free (parser); if (context != NULL) g_markup_parse_context_free (context); diff --git a/gio/gnetworkaddress.c b/gio/gnetworkaddress.c index 0519713..5cb4c74 100644 --- a/gio/gnetworkaddress.c +++ b/gio/gnetworkaddress.c @@ -181,8 +181,7 @@ g_network_address_set_property (GObject *object, break; case PROP_SCHEME: - if (addr->priv->scheme) - g_free (addr->priv->scheme); + g_free (addr->priv->scheme); addr->priv->scheme = g_value_dup_string (value); break; diff --git a/gio/gnetworkservice.c b/gio/gnetworkservice.c index fb37620..497d6fd 100644 --- a/gio/gnetworkservice.c +++ b/gio/gnetworkservice.c @@ -350,8 +350,7 @@ g_network_service_set_scheme (GNetworkService *srv, { g_return_if_fail (G_IS_NETWORK_SERVICE (srv)); - if (srv->priv->scheme) - g_free (srv->priv->scheme); + g_free (srv->priv->scheme); srv->priv->scheme = g_strdup (scheme); g_object_notify (G_OBJECT (srv), "scheme");