Memory leak fix

Need to free previous backend name when changing it.
Memory leak fix

Free temporary variable in mdb_print_indexes