Adrian Schreyer <ams214(at)cam(dot)ac(dot)uk> writes:
> The actual C++ function looks roughly like this
> extern "C"
> char *function(bytea *b)
> {
> string ism;
> [...]
> return ism.c_str();
> }
My C++ is pretty rusty, but is the pointer returned by c_str() still
valid after the string variable goes out of scope? I'm wondering if you
need a pstrdup before returning.
regards, tom lane