Avoid potential double free cases. This fixes a clang warning during scan-build. Change-Id: I487d6fcd485d1f8ebb96b6f8cb54511628461f39 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>