Fix for possible memory leak

Signed-off-by: Midhun Kodiyath <midhunchandra.kodiyath@intel.com>