diff options
Diffstat (limited to 'source/lib/bitmap.c')
-rw-r--r-- | source/lib/bitmap.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/lib/bitmap.c b/source/lib/bitmap.c index b130467b22f..7625f529095 100644 --- a/source/lib/bitmap.c +++ b/source/lib/bitmap.c @@ -21,9 +21,12 @@ #include "includes.h" +extern int DEBUGLEVEL; + /* these functions provide a simple way to allocate integers from a pool without repitition */ + /**************************************************************************** allocate a bitmap of the specified size ****************************************************************************/ @@ -38,7 +41,7 @@ struct bitmap *bitmap_allocate(int n) bm->n = n; bm->b = (uint32 *)malloc(sizeof(bm->b[0])*(n+31)/32); if (!bm->b) { - SAFE_FREE(bm); + free(bm); return NULL; } @@ -56,8 +59,10 @@ void bitmap_free(struct bitmap *bm) if (!bm) return; - SAFE_FREE(bm->b); - SAFE_FREE(bm); + if(bm->b) + free(bm->b); + + free(bm); } /**************************************************************************** |