Fix Use After Free.

Signed-off-by: Srikrishan Malik <srimalik@in.ibm.com>