]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
add CLANG_SANITIZER define
authorJaroslav Kysela <perex@perex.cz>
Thu, 10 Mar 2016 09:09:57 +0000 (10:09 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 10 Mar 2016 09:09:57 +0000 (10:09 +0100)
src/httpc.c
src/tvheadend.h

index f51ed9520f01674c16a6477e9daa8dec711e1831..9882c83590e31a18ec0196b68f5c9f625a905c77 100644 (file)
@@ -1595,7 +1595,13 @@ http_client_close ( http_client_t *hc )
   free(hc->hc_bindaddr);
   free(hc->hc_rtsp_user);
   free(hc->hc_rtsp_pass);
+#ifdef CLANG_SANITIZER
+  pthread_mutex_lock(&http_lock);
+#endif
   free(hc);
+#ifdef CLANG_SANITIZER
+  pthread_mutex_unlock(&http_lock);
+#endif
 }
 
 /*
index 43c5defe9b23543782eef8e786ab084a976fa9df..20ee1f60a55d1c0abe14b4054693dc5ffef9d538 100644 (file)
@@ -115,6 +115,12 @@ lock_assert0(pthread_mutex_t *l, const char *file, int line)
 
 #define lock_assert(l) lock_assert0(l, __FILE__, __LINE__)
 
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer) || __has_feature(thread_sanitizer)
+#define CLANG_SANITIZER 1
+#endif
+#endif
+
 /*
  *
  */