This could also be a bug in apitrace, couldn't it? Can you try running it in valgrind --leak-check=full to see if that shows anything interesting?