fixed memleak in SQL config lookup