dev/fix-memleaks

Found some memory leaks/errors with valgrind. Please verify before merging (there are lots of other things valgrind was complaining about from fontconfig, mesa, and the Intel driver, so I may have missed something in the noise).