Fix some potential memory leaks within graphics.c
Merge pull request #48 from lioncash/leaks

Fix some potential memory leaks within graphics.c