As pointed by Evan: don't leak memory when the string pointer is NULL.
authorJeff Morriss <jeff.morriss.ws@gmail.com>
Sun, 27 Oct 2013 22:40:55 +0000 (22:40 -0000)
committerJeff Morriss <jeff.morriss.ws@gmail.com>
Sun, 27 Oct 2013 22:40:55 +0000 (22:40 -0000)
svn path=/trunk/; revision=52908

epan/proto.c

index b7b0d40bcd356453b73b6d1e0f462978eff10883..f64378a82c18eeea38758ac7f135eb38cafbe67b 100644 (file)
@@ -2595,7 +2595,7 @@ proto_tree_set_string(field_info *fi, const char* value, gint length)
        if (value) {
                fvalue_set(&fi->value, (gpointer) g_strndup(value, length), TRUE);
        } else {
-               fvalue_set(&fi->value, (gpointer) g_strdup("[ Null ]"), FALSE);
+               fvalue_set(&fi->value, (gpointer) "[ Null ]", FALSE);
        }
 }