[sr-dev] [tracker] Comment added: Possible memory leak in srdb1

sip-router bugtracker at sip-router.org
Wed Jul 17 12:46:00 CEST 2013


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#319 - Possible memory leak in srdb1
User who did this - Daniel-Constantin Mierla (miconda)

----------
I checked and the column name is not allocated dynamically by kamailio, but points to a structure to underline db lib. I looked at db_mysql and db_postgres.

For example with postgres, the column is set with:

  /* The pointer that is here returned is part of the result structure. */
  RES_NAMES(_r)[col]->s = PQfname(CON_RESULT(_h), col);
  RES_NAMES(_r)[col]->len = strlen(PQfname(CON_RESULT(_h), col));

Now, looking at postgres lib manual:

PQfname - Returns the column name associated with the given column number. Column numbers start at 0. The caller should not free the result directly. It will be freed when the associated PGresult handle is passed to PQclear.

Therefore kamailio should not free RES_NAMES(_r)[col]->s.

If you think is different, provide more details of how you consider that RES_NAMES(_r)[col]->s is allocated dynamically by kamailio.

----------

More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=319#comment1008

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the sr-dev mailing list