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

View File

@ -835,7 +835,6 @@ meta_screen_free (MetaScreen *screen,
if (screen->check_fullscreen_later != 0) if (screen->check_fullscreen_later != 0)
meta_later_remove (screen->check_fullscreen_later); 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) if (screen->tile_preview_timeout_id)

View File

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

View File

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

View File

@ -1117,7 +1117,6 @@ meta_color_spec_free (MetaColorSpec *spec)
break; break;
case META_COLOR_SPEC_GTK_CUSTOM: 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) if (spec->data.gtkcustom.fallback)
meta_color_spec_free (spec->data.gtkcustom.fallback); meta_color_spec_free (spec->data.gtkcustom.fallback);
@ -2956,9 +2955,7 @@ meta_draw_op_free (MetaDrawOp *op)
break; break;
case META_DRAW_RECTANGLE: 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.x);
meta_draw_spec_free (op->data.rectangle.y); meta_draw_spec_free (op->data.rectangle.y);
meta_draw_spec_free (op->data.rectangle.width); meta_draw_spec_free (op->data.rectangle.width);
@ -2966,9 +2963,7 @@ meta_draw_op_free (MetaDrawOp *op)
break; break;
case META_DRAW_ARC: 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.x);
meta_draw_spec_free (op->data.arc.y); meta_draw_spec_free (op->data.arc.y);
meta_draw_spec_free (op->data.arc.width); meta_draw_spec_free (op->data.arc.width);