Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/lib/util/bitmap.c

    r921 r988  
    2121#include "lib/util/bitmap.h"
    2222
     23struct bitmap {
     24        unsigned int n;
     25        uint32_t b[1];          /* We allocate more */
     26};
     27
    2328/* these functions provide a simple way to allocate integers from a
    2429   pool without repetition */
     
    3136        struct bitmap *bm;
    3237
    33         bm = talloc_zero(mem_ctx, struct bitmap);
     38        bm = (struct bitmap *)talloc_zero_size(
     39                mem_ctx,
     40                offsetof(struct bitmap, b) + sizeof(uint32_t)*((n+31)/32));
    3441
    3542        if (!bm) return NULL;
    3643
     44        talloc_set_name_const(bm, "struct bitmap");
     45
    3746        bm->n = n;
    38         bm->b = talloc_zero_array(bm, uint32_t, (n+31)/32);
    39         if (!bm->b) {
    40                 TALLOC_FREE(bm);
    41                 return NULL;
    42         }
    4347        return bm;
    4448}
Note: See TracChangeset for help on using the changeset viewer.