compile: fix possible memory leak issues

 * potential issues reported by klocwork

Signed-off-by: Wind Yuan <feng.yuan@intel.com>
18 files changed