Fix bug.

1. memory leak.
2. file not found.

Signed-off-by: Yunchao Chen <chenyc@infthink.com>