Catch the NULL cases, fix memory leak.
Catch the NULL cases, fix memory leak.

jjz/libetpan,jjz/libetpan,tipbit/libetpan,tipbit/libetpan,disaykin/libetpan,disaykin/libetpan,jjz/libetpan,disaykin/libetpan,tipbit/libetpan