Avoid valgrind warning.

While hunting https://github.com/miguelfreitas/twister-core/issues/27 I came across a valgrind warning; this should fix it.