mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 06:32:10 +01:00
Remove redundant checks before free
Remove checks for NULL before g_free(). https://bugzilla.gnome.org/show_bug.cgi?id=733156
This commit is contained in:
parent
24d614357a
commit
c7c4c3bf5e
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user