Commit c7c4c3bf authored by Marek Kašík's avatar Marek Kašík

Remove redundant checks before free

Remove checks for NULL before g_free().

https://bugzilla.gnome.org/show_bug.cgi?id=733156
parent 24d61435
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment