error output of valgrind in examples:  invalid memory access