Resource leak in sdbquery