allow NULL
authorChristian Grothoff <christian@grothoff.org>
Wed, 12 Oct 2011 14:21:18 +0000 (14:21 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 12 Oct 2011 14:21:18 +0000 (14:21 +0000)
src/util/common_logging.c

index e7818e0f483ca3d2da605c48aff2e1b2d633e065..503fb671de77659a92641da06b90586c8188d3ef 100644 (file)
@@ -289,7 +289,9 @@ add_definition (char *component, char *file, char *function, int from_line,
       n.file = strdup (file);
       n.strlen_file = strlen (file);
     }
-  if (strlen (function) > 0 && function[0] != '*')
+  if ( (NULL != function) &&
+       (strlen (function) > 0) && 
+       (function[0] != '*') )
     n.function = strdup (function);
   n.from_line = from_line;
   n.to_line = to_line;