#226 Fix freeing of a db SQL resource

closed-accepted
nobody
core (47)
5
2012-07-03
2012-06-14
No

We should mark type of the resource structure as NULL when we freeing it in order to prevent access to a NULL-ified fields in the future.

Discussion

  • Vladut-Stefan Paiu

    Hello,

    The '0002-Free-columns-data-as-well.patch' doesn't seem to be ok, since it also tries to pkg_free the actual column values. PKG allocation like this only happens for db_oracle, other modules rely on their libraries to allocate the actual column name and to also free it. Thus, the column data freeing should be placed in db_oracle_free_result .

    The second patch is ok, as it's a good idea to completely reset the column info after freeing them.

    Regards,
    Vlad

     
  • Peter Lemenkov

    Peter Lemenkov - 2012-07-03

    Hello Vlad!
    Sorry for the late answer - I overlooked your message. Yes, indeed 0002 patch must be dropped (I'm going to remove it right now). We already moved its logic into db_oracle (where it should be) - I'll post it later with the rest of a db_oracle related stuff.

    So how about applying only first one?

     
  • Vladut-Stefan Paiu

    Hello,

    Patch applied on OpenSIPS trunk.

    Thanks and Regards,
    Vlad

     
  • Vladut-Stefan Paiu

    • status: open --> closed-accepted
     

Log in to post a comment.