summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc-standard/free.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-03-29 04:50:56 -0500
committerWaldemar Brodkorb <wbx@openadk.org>2015-03-29 04:50:56 -0500
commitcd5f92704e1e17bbc0c15d197f3bc236c7dc9bf2 (patch)
tree1400302b543e4528aedea5d72731983559cfcf36 /libc/stdlib/malloc-standard/free.c
parentad2bffbf1926051ef333f9899344f6bddf2c03cf (diff)
parent24946289317ea23bb0d1814cca0a499a905f7d6f (diff)
merge uClibc git master
Diffstat (limited to 'libc/stdlib/malloc-standard/free.c')
-rw-r--r--libc/stdlib/malloc-standard/free.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libc/stdlib/malloc-standard/free.c b/libc/stdlib/malloc-standard/free.c
index 39e54d635..8b7a81fca 100644
--- a/libc/stdlib/malloc-standard/free.c
+++ b/libc/stdlib/malloc-standard/free.c
@@ -104,9 +104,13 @@ static int __malloc_trim(size_t pad, mstate av)
*/
int malloc_trim(size_t pad)
{
+ int r;
+ __MALLOC_LOCK;
mstate av = get_malloc_state();
__malloc_consolidate(av);
- return __malloc_trim(pad, av);
+ r = __malloc_trim(pad, av);
+ __MALLOC_UNLOCK;
+ return r;
}
/*