From: Marion Guthmuller Date: Mon, 8 Oct 2012 23:15:23 +0000 (+0200) Subject: UNLOCK forgotten before THROWF X-Git-Tag: v3_8~99^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5a935e095de098cfd4f0947e3c30748f09a0721e?ds=sidebyside UNLOCK forgotten before THROWF --- diff --git a/src/xbt/mmalloc/mfree.c b/src/xbt/mmalloc/mfree.c index b264ec381d..754ff3098b 100644 --- a/src/xbt/mmalloc/mfree.c +++ b/src/xbt/mmalloc/mfree.c @@ -40,6 +40,7 @@ void mfree(struct mdesc *mdp, void *ptr) switch (type) { case -1: /* Already free */ + UNLOCK(mdp); THROWF(system_error, 0, "Asked to free a fragment in a block that is already free. I'm puzzled\n"); break; @@ -152,8 +153,10 @@ void mfree(struct mdesc *mdp, void *ptr) /* Set size used in the fragment to 0 */ frag_nb = RESIDUAL(ptr, BLOCKSIZE) >> type; - if( mdp->heapinfo[block].busy_frag.frag_size[frag_nb] == 0) + if( mdp->heapinfo[block].busy_frag.frag_size[frag_nb] == 0){ + UNLOCK(mdp); THROWF(system_error, 0, "Asked to free a fragment that is already free. I'm puzzled\n"); + } mdp->heapinfo[block].busy_frag.frag_size[frag_nb] = 0;