fix a memory leak in the hello world example

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>