Fixed memory leak in out of memory situations (ironic, yes)