nullify the memory chunk to avoid crashes when freeing resource

This commit is contained in:
Anatol Belski 2015-09-22 20:33:46 +02:00
parent 0e843a4582
commit faa50318a3

View file

@ -437,6 +437,7 @@ static shm_pair *shm_get(int key, void *addr)
TWG(shm) = newptr;
ptr = newptr + TWG(shm_size);
TWG(shm_size)++;
memset(ptr, 0, sizeof(*ptr));
return ptr;
}