]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Followup to r8178: don't segfault if VG_(clo_log_name) is NULL.
authorJulian Seward <jseward@acm.org>
Wed, 4 Jun 2008 09:07:36 +0000 (09:07 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 4 Jun 2008 09:07:36 +0000 (09:07 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8181

coregrind/m_main.c

index 771747096599f062266e67d2041663ddf9a7cf15..e637f7a056b4f64e7c1b7e71b416c6080ac5136e 100644 (file)
@@ -854,7 +854,8 @@ static void print_preamble(Bool logging_to_fd, const char* toolname)
       VG_(message)(Vg_UserMsg, "<pid>%d</pid>", VG_(getpid)());
       VG_(message)(Vg_UserMsg, "<ppid>%d</ppid>", VG_(getppid)());
       VG_(message)(Vg_UserMsg, "<tool>%t</tool>", toolname);
-      print_file_vars(VG_(clo_log_name));
+      if (VG_(clo_log_name))
+         print_file_vars(VG_(clo_log_name));
       if (VG_(clo_xml_user_comment)) {
          /* Note: the user comment itself is XML and is therefore to
             be passed through verbatim (%s) rather than escaped