[librsvg] Don't accidentally return NULL from parse_style_value()



commit 197a8fe3b15d01893ab0d1cd64e23dfeb7ca75a9
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 18 17:27:26 2011 -0500

    Don't accidentally return NULL from parse_style_value()
    
    Callers don't expect it and things go bad...
    https://bugzilla.gnome.org/show_bug.cgi?id=626802

 rsvg-styles.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/rsvg-styles.c b/rsvg-styles.c
index bd59a10..7498ec9 100644
--- a/rsvg-styles.c
+++ b/rsvg-styles.c
@@ -887,7 +887,10 @@ parse_style_value (const gchar *string, gchar **value, gboolean *important)
     } else {
         *important = FALSE;
     }
-    *value = g_strdup (g_strstrip (strings[0]));
+    if (strings[0])
+        *value = g_strdup (g_strstrip (strings[0]));
+    else
+        *value = g_strdup ("");
 
     g_strfreev (strings);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]