first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[kai/samba-autobuild/.git] / source3 / lib / bitmap.c
index 93c821c52853d9af7dd092a69aecb4b412ab99a6..1813d63ff77892ae6d2f87b570605177a6c1c35f 100644 (file)
@@ -35,10 +35,10 @@ struct bitmap *bitmap_allocate(int n)
        struct bitmap *bm;
 
        bm = (struct bitmap *)malloc(sizeof(*bm));
-       bm->n = n;
 
        if (!bm) return NULL;
        
+       bm->n = n;
        bm->b = (uint32 *)malloc(sizeof(bm->b[0])*(n+31)/32);
        if (!bm->b) {
                free(bm);