- When mcheck () fails in MRP_INIT time and then mprobe () returns MCHECK_DISABLED, which needs
to free memory otherwise occur abnormal memory corruption.
For more detailed, MRP_INIT (memory_check_init) is executed in the parent process of forking and
__passthru_free is executed in the child process. So variable (mcheck_result) is unnecessary because
we can consider mprobe returns always only MCHECK_DISABLED and mcheck is not performed at child process.
Change-Id: I123d3af30cb1b84b34b09349952a225ee0ec91ad
Summary: Resource policy framework
Name: murphy
Version: 0.0.75
-Release: 14
+Release: 15
License: BSD-3-Clause
Group: System/Service
URL: http://01.org/murphy/
}
#ifndef TIZEN_DISABLE_MEMORY_CHECK
-MRP_INIT static void menory_check_init()
+MRP_INIT static void memory_check_init()
{
mcheck(NULL);
}
#ifdef TIZEN_DISABLE_MEMORY_CHECK
free(ptr);
#else
- if (mprobe(ptr) == MCHECK_OK)
+ enum mcheck_status s = mprobe(ptr);
+ if (s == MCHECK_OK || s == MCHECK_DISABLED)
free(ptr);
- else {
+ else
mrp_log_warning("Invalid pointer passed to fuction free");
- }
#endif
}