Remove a few more guards for frees

This commit is contained in:
Jasper St. Pierre 2014-12-28 19:50:25 -08:00
parent b10a017446
commit cd4206764e
5 changed files with 9 additions and 21 deletions

View File

@ -571,8 +571,7 @@ handle_preference_init_string (void)
if (!cursor->target)
meta_bug ("%s must have handler or target\n", cursor->base.key);
if (*(cursor->target))
g_free (*(cursor->target));
g_free (*(cursor->target));
value = g_settings_get_string (SETTINGS (cursor->base.schema),
cursor->base.key);
@ -728,8 +727,7 @@ handle_preference_update_string (GSettings *settings,
inform_listeners = (g_strcmp0 (value, *(cursor->target)) != 0);
if (*(cursor->target))
g_free(*(cursor->target));
g_free(*(cursor->target));
*(cursor->target) = value;
}
@ -1391,9 +1389,7 @@ theme_name_handler (GVariant *value,
if (g_strcmp0 (current_theme, string_value) != 0)
{
if (current_theme)
g_free (current_theme);
g_free (current_theme);
current_theme = g_strdup (string_value);
queue_changed (META_PREF_THEME);
}

View File

@ -835,8 +835,7 @@ meta_screen_free (MetaScreen *screen,
if (screen->check_fullscreen_later != 0)
meta_later_remove (screen->check_fullscreen_later);
if (screen->monitor_infos)
g_free (screen->monitor_infos);
g_free (screen->monitor_infos);
if (screen->tile_preview_timeout_id)
g_source_remove (screen->tile_preview_timeout_id);

View File

@ -330,8 +330,7 @@ test_client_do (TestClient *client,
out:
g_string_free (command, TRUE);
if (line)
g_free (line);
g_free (line);
return *error == NULL;
}

View File

@ -609,8 +609,7 @@ meta_frames_unmanage_window (MetaFrames *frames,
if (frame->layout)
g_object_unref (G_OBJECT (frame->layout));
if (frame->title)
g_free (frame->title);
g_free (frame->title);
g_free (frame);
}

View File

@ -1117,8 +1117,7 @@ meta_color_spec_free (MetaColorSpec *spec)
break;
case META_COLOR_SPEC_GTK_CUSTOM:
if (spec->data.gtkcustom.color_name)
g_free (spec->data.gtkcustom.color_name);
g_free (spec->data.gtkcustom.color_name);
if (spec->data.gtkcustom.fallback)
meta_color_spec_free (spec->data.gtkcustom.fallback);
DEBUG_FILL_STRUCT (&spec->data.gtkcustom);
@ -2956,9 +2955,7 @@ meta_draw_op_free (MetaDrawOp *op)
break;
case META_DRAW_RECTANGLE:
if (op->data.rectangle.color_spec)
g_free (op->data.rectangle.color_spec);
g_free (op->data.rectangle.color_spec);
meta_draw_spec_free (op->data.rectangle.x);
meta_draw_spec_free (op->data.rectangle.y);
meta_draw_spec_free (op->data.rectangle.width);
@ -2966,9 +2963,7 @@ meta_draw_op_free (MetaDrawOp *op)
break;
case META_DRAW_ARC:
if (op->data.arc.color_spec)
g_free (op->data.arc.color_spec);
g_free (op->data.arc.color_spec);
meta_draw_spec_free (op->data.arc.x);
meta_draw_spec_free (op->data.arc.y);
meta_draw_spec_free (op->data.arc.width);