[sr-dev] git:master:b95b2448: nats: make sure pkg & shm memory is allocated; check pointers before freeing memory