Fixed memory leak on detection of redundant SQL clauses

Fixed memory leak where detected redundant SQL clauses are removed, but not freed.