fix the static analzyer warning for potential memory leak