Fix a couple of memory leaks in backends.