From 03b12897de792083dd9686f96849af5f069ab2e0 Mon Sep 17 00:00:00 2001 From: bulia byak Date: Thu, 24 Jul 2008 06:56:53 +0000 Subject: fix crash when writing style with empty font-family (bzr r6406) --- src/style.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/style.cpp b/src/style.cpp index 766f5a7fb..1d4384c4c 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -3387,8 +3387,10 @@ sp_style_write_istring(gchar *p, gint const len, gchar const *const key, return g_snprintf(p, len, "%s:inherit;", key); } else { gchar *val_quoted = css2_escape_quote(val->value); - return g_snprintf(p, len, "%s:%s;", key, val_quoted); - g_free (val_quoted); + if (val_quoted) { + return g_snprintf(p, len, "%s:%s;", key, val_quoted); + g_free (val_quoted); + } } } return 0; -- cgit v1.2.3