summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/murphy.spec1
-rw-r--r--src/common/mm.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/packaging/murphy.spec b/packaging/murphy.spec
index faaa212..b58e7c3 100644
--- a/packaging/murphy.spec
+++ b/packaging/murphy.spec
@@ -189,6 +189,7 @@ cp %{SOURCE1001} .
%build
%if "%{asan}" == "1"
%restore_fcommon
+export CFLAGS="-DTIZEN_DISABLE_MEMORY_CHECK"
%endif
%if %{with debug}
export CFLAGS="-O0 -g3"
diff --git a/src/common/mm.c b/src/common/mm.c
index a1a98a2..d6e595d 100644
--- a/src/common/mm.c
+++ b/src/common/mm.c
@@ -523,10 +523,12 @@ static int __passthru_memalign(void **ptr, size_t align, size_t size,
return posix_memalign(ptr, align, size);
}
+#ifndef TIZEN_DISABLE_MEMORY_CHECK
MRP_INIT static void menory_check_init()
{
mcheck(NULL);
}
+#endif
static void __passthru_free(void *ptr, const char *file, int line,
const char *func)
@@ -536,12 +538,15 @@ static void __passthru_free(void *ptr, const char *file, int line,
MRP_UNUSED(func);
if (ptr == NULL)
return;
-
+#ifdef TIZEN_DISABLE_MEMORY_CHECK
+ free(ptr);
+#else
if (mprobe(ptr) == MCHECK_OK)
free(ptr);
else {
mrp_log_warning("Invalid pointer passed to fuction free");
}
+#endif
}