fix NULL pointer access on sendto glue code

fix the issue #17.