Paul Hampson wrote:

> > I think it'd be better to have a separate patch to fix
> > sql_finish_query() usage everywhere and not only in
> > rlm_sql_postauth()
> 
> SOunds good. Are you going to make it call it always? I expect
> such a function would be safe to call at any time... From memory,
> the mySQL provides such a function, but its not implemented in
> rlm_sql_mysql at the moment. I'll also have to look into that
> sometime.

mySQL provides a mysql_free_result() that you're supposed to call
after a mysql_store_result().

So I'm thinking that:

* sql_select_query() calls mysql_store_result() and therefore
sql_finish_select_query() calls mysql_free_result()

* sql_query() don't allocate supplementary resources so
sql_finish_query() does nothing and it's just fine.

Moreover (now that I read the entire source code) if you really want
to call sql_finish_query() after a failed sql_query() I think the best
place to do it is the function rlm_sql_query() in sql.c and not in a
lot of different places in rlm_sql.c

Since this issue has nothing to do with rlm_sql_postauth() I think
you could safely commit the patch now.

-- 
Nicolas Baradakis

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to