[OpenSIPS-Users] Bug in modules/db_postgres/res.c

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Dec 21 18:20:02 CET 2009


Hi Alexander,

Thanks you for the fix, I uploaded in on SVN.

Regards,
Bogdan

Alexander wrote:
>   Hello,
>
>   I've  found  a bug in db_postgres module. In res.c file, near line 291, we can
> see:
>
>   for (col = 0; col < RES_COL_N(_r); col++) {
>        switch (RES_TYPES(_r)[col]) {
>            case DB_STRING:
>            case DB_STR:
>                break;
>            default:
>                LM_DBG("freeing row_buf[%d] at %p\n", col, row_buf[col]);
>                pkg_free(row_buf[col]);
>        }
>
>   pkg_free() is called wrong, it should be like this:
>
>   if (row_buf[col]) pkg_free(row_buf[col])
>
>   Without  this  'if',  OpenSIPS produces "WARNING:core:fm_free: free(0) called"
> and sometimes even crashes.
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list