Initialized global pointers to NULL. Moved free() out of locks. Moved memset() before utilization.
Moved to slab cache instead of kmalloc in socket initialisation.