[gtk+] snapshot: Avoid a double-free
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] snapshot: Avoid a double-free
- Date: Tue, 14 Feb 2017 16:00:25 +0000 (UTC)
commit 08355997c2666fee0d54f0eb8316f99b0087fac8
Author: Timm Bäder <mail baedert org>
Date: Tue Feb 14 13:23:08 2017 +0100
snapshot: Avoid a double-free
We can't pass the same string to two different snapshot states since
removing one of them will free the passed string, so just create another
one for the second state.
gtk/gtksnapshot.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index 7b8bfdd..77146e4 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -742,7 +742,7 @@ gtk_snapshot_push_blend (GtkSnapshot *snapshot,
state->data.blend.bottom_node = NULL;
state = gtk_snapshot_state_new (state,
- str,
+ g_strdup (str),
state->clip_region,
state->translate_x,
state->translate_y,
@@ -863,7 +863,7 @@ gtk_snapshot_push_cross_fade (GtkSnapshot *snapshot,
state->data.cross_fade.start_node = NULL;
state = gtk_snapshot_state_new (state,
- str,
+ g_strdup (str),
state->clip_region,
state->translate_x,
state->translate_y,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]