[sanitizer] Fix memory leak in sanitizer_common discovered by LeakSanitizer.
authorSergey Matveev <earthdok@google.com>
Wed, 3 Jul 2013 13:45:13 +0000 (13:45 +0000)
committerSergey Matveev <earthdok@google.com>
Wed, 3 Jul 2013 13:45:13 +0000 (13:45 +0000)
llvm-svn: 185536

compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc

index 239df35..a00a8e2 100644 (file)
@@ -63,6 +63,7 @@ void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top,
     return;
   }
   pthread_attr_t attr;
+  pthread_attr_init(&attr);
   CHECK_EQ(pthread_getattr_np(pthread_self(), &attr), 0);
   uptr stacksize = 0;
   void *stackaddr = 0;