IT makers sense. Verzonden vanuit Outlook Mobile
On Fri, Mar 11, 2016 at 11:55 AM -0800, "Rodrigo Pimenta Carvalho" <[email protected]> wrote: Hi. I'm using a release of OpenSIPS 2.1 from 2015. When I use avp_db_query to execute SQL Select, everything is ok. However if I use avp_db_query to execute, let's say, a SQL Update, there is a misinterpretation of a parameter in db_sqlite_free. The parameter _r will be null and the original function db_sqlite_free interprets it as an invalid parameter. But it is not. For SQL Updates, the result (_r) will be null. It is not an error. So, there is no need to log 'invalid parameter value' message. In this case, I have changed the beginning of the function db_sqlite_free as you can see: /** * Release a result set from memory. * \param _h handle to the database * \param _r result set that should be freed * \return zero on success, negative value on failure */ int db_sqlite_free_result(db_con_t* _h, db_res_t* _r) { int i; int j; db_val_t* v; db_row_t* res_col; if (!_h) { LM_ERR("invalid parameter value "); return -1; } if (!_r){ return 0; //Returns zero because it is not a problem when this parameter is null, for example. } . . . Does it make sense? Regards. RODRIGO PIMENTA CARVALHO Inatel Competence Center Software Ph: +55 35 3471 9200 RAMAL 979
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
