Fix a valgrind warning about mismatched free()