https://bz.apache.org/bugzilla/show_bug.cgi?id=68647

--- Comment #1 from Christophe JAILLET <christophe.jail...@wanadoo.fr> ---
Hi,

see the same question a few years ago:
   https://lists.apache.org/thread/hr2t965lgdcb0f8vzpq2b8jh771z3m6h



For apr_pstrdup() vs apr_table_setn(), I see 2 possibilities:

1) it can be a question of lifetime of the string.

Most of memory allocations in httpd are done using pools which can have a
different lifetimes.
So sometimes it is needed to copy a string in another pool because it is needed
in another context with another lifetime.


2) When apr_table_setn() is used, the string is not copied in the table, only a
reference to it is stored in the table. So, if you need to modify the string,
then you need to copy it first. Otherwise, the original string is modified
as-well.


Anyway, it is likely that some optimisation can be done.
Patches welcomed :)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscr...@httpd.apache.org
For additional commands, e-mail: bugs-h...@httpd.apache.org

Reply via email to