map icon indicating copy to clipboard operation
map copied to clipboard

map_deinit crash after map_init without add any values

Open GF-Huang opened this issue 5 years ago • 1 comments

map_init(&m);
map_deinit(&m);  // crash

image

GF-Huang avatar Aug 19 '19 04:08 GF-Huang

map_init will set m->nbuckets to 0, how could you step into the while loop without any map_set_ operations?

#define map_init(m)\
  memset(m, 0, sizeof(*(m)))

catlause avatar Sep 27 '19 03:09 catlause