Release root pointer when it is not used anymore.

Signed-off-by: Thiago Farina <tfarina@chromium.org>