[librsvg/rustification] rsvg_state_finalize(): Clear freed fields
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustification] rsvg_state_finalize(): Clear freed fields
- Date: Wed, 9 Nov 2016 23:44:04 +0000 (UTC)
commit a450f40e58a0af5d1133a2b82bf52518946d0b51
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Nov 9 14:50:29 2016 -0600
rsvg_state_finalize(): Clear freed fields
rsvg-styles.c | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/rsvg-styles.c b/rsvg-styles.c
index a95c6b0..6e91981 100644
--- a/rsvg-styles.c
+++ b/rsvg-styles.c
@@ -472,18 +472,40 @@ void
rsvg_state_finalize (RsvgState * state)
{
g_free (state->filter);
+ state->filter = NULL;
+
g_free (state->mask);
+ state->mask = NULL;
+
g_free (state->clip_path);
+ state->clip_path = NULL;
+
g_free (state->font_family);
+ state->font_family = NULL;
+
g_free (state->lang);
+ state->lang = NULL;
+
g_free (state->startMarker);
+ state->startMarker = NULL;
+
g_free (state->middleMarker);
+ state->middleMarker = NULL;
+
g_free (state->endMarker);
+ state->endMarker = NULL;
+
rsvg_paint_server_unref (state->fill);
+ state->fill = NULL;
+
rsvg_paint_server_unref (state->stroke);
+ state->stroke = NULL;
- if (state->dash.n_dash != 0)
+ if (state->dash.n_dash != 0) {
g_free (state->dash.dash);
+ state->dash.n_dash = 0;
+ state->dash.dash = NULL;
+ }
if (state->styles) {
g_hash_table_unref (state->styles);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]