From fe424995a5ece284f65fd53e64a5d28897e4e0ea Mon Sep 17 00:00:00 2001 From: buliabyak Date: Thu, 24 Jul 2008 06:56:53 +0000 Subject: [PATCH] fix crash when writing style with empty font-family --- src/style.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.30.2