MEMUNLOCK called too early

This commit is contained in:
Mark Andrews 2005-08-22 01:33:03 +00:00
parent 36ca24a121
commit d3195a7f45

View file

@ -24,7 +24,7 @@
#if !defined(LINT) && !defined(CODECENTER)
static const char rcsid[] = "$Id: memcluster.c,v 1.8 2005/07/28 06:51:49 marka Exp $";
static const char rcsid[] = "$Id: memcluster.c,v 1.9 2005/08/22 01:33:03 marka Exp $";
#endif /* not lint */
#include "port_before.h"
@ -194,9 +194,10 @@ __memget_record(size_t size, const char *file, int line) {
UNUSED(line);
#endif
if (freelists == NULL) {
MEMUNLOCK;
if (meminit(0, 0) == -1)
if (meminit(0, 0) == -1) {
MEMUNLOCK;
return (NULL);
}
}
if (size == 0U) {
MEMUNLOCK;