Code

fix crash when writing style with empty font-family
authorbuliabyak <buliabyak@users.sourceforge.net>
Thu, 24 Jul 2008 06:56:53 +0000 (06:56 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Thu, 24 Jul 2008 06:56:53 +0000 (06:56 +0000)
src/style.cpp

index 766f5a7fbe7b021b94c136417492641b5f212209..1d4384c4ca7ef869eecd5b962a177cdbdbf7c4e7 100644 (file)
@@ -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;