Fix memory leaks as well as add infrastructure to get the qos name from
a partition.