Fixing process cleaning up memory leak

Change-Id: I009cfcc1efbb2102fc29ff1666d5d7b43cd17096
Signed-off-by: TanelDettenborn <tanel.dettenborn@gmail.com>