Re: cvs: php-src / NEWS /ext/pgsql config.m4 config.w32pgsql.c /ext/pgsql/tests 08escape.phpt 25async_query_params.phpt
| From: | l0t3k | Date: | Wed, 30 Mar 2005 19:38:05 +0000 |
| Subject: | Re: cvs: php-src / NEWS /ext/pgsql config.m4 config.w32pgsql.c /ext/pgsql/tests 08escape.phpt 25async_query_params.phpt | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15674@lists.php.net to get a copy of this message | ||
Christopher,
>
> I want to return a string allocated by the postgresql library. However,
> PHP ends up efree()ing it I think, which causes a miscount error. How can
> I deal with this?
don't mix php allocated memory with externally allocated memory. if you
want to return a string from pgsql, you have to estrdup() it, otherwise Bad
Things (tm)
happen.
take a look at the RETURN_STRING[L] macro. the last argument determines
whether the string passed to it is duplicated by PHP before returning it to
the user.
l0t3k