use enum rather than random int for readablity
remove useless null checks prior to free, free is a noop if the pointers are null
use calloc to allocate the hexchat_plugin struct, this will ensure that all the pointers it contains are NULL until initialized
remove uneeded null checks before calls to free().