Milter question: smfi_getsymval() & memory
Hi, if i use smfi_getsymval() , am i responsible for later free()'ing
the pointer it returns? Or does the milter library take care of that
on its own? Or is it static memory (doesn't seem likely)? The
libmilter docs don't touch upon this matter.
Thanks...
Re: Milter question: smfi_getsymval() & memory
wrote:
> Hi, if i use smfi_getsymval() , am i responsible for later free()'ing
> the pointer it returns? Or does the milter library take care of that
> on its own? Or is it static memory (doesn't seem likely)? The
> libmilter docs don't touch upon this matter.
smfi_getsymval.html:
NOTES By default, the following macros are valid in the given
contexts:
+---------------------------------------------------------+
| Sent With | Macros |
|------------+--------------------------------------------|
|xxfi_connect|daemon_name, if_name, if_addr, j, _ |
|------------+--------------------------------------------|
|xxfi_helo |tls_version, cipher, cipher_bits, |
| |cert_subject, cert_issuer |
|------------+--------------------------------------------|
| |i, auth_type, auth_authen, auth_ssf, |
|xxfi_envfrom|auth_author, mail_mailer, mail_host, |
| |mail_addr |
|------------+--------------------------------------------|
|xxfi_envrcpt|rcpt_mailer, rcpt_host, rcpt_addr |
+---------------------------------------------------------+
All macros stay in effect from the point they are received
until the end of the connection for the first two sets, the
end of the message for the third (xxfi_envfrom), and just
for each recipient for the final set (xxfi_envrcpt).
The least sentence explains the "lifetime" of the storage. If you
want to have access for a longer "time" you need to manage it
yourself.
--
A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Re: Milter question: smfi_getsymval() & memory
Claus Aßmann wrote:
> The least sentence explains the "lifetime" of the storage.
Ah, okay, thank you. I'd read that part, but had misunderstood it to
refer to the meaningful context of the sendmail macros themselves, and
not the storage allocatd by the library call. Thanks again!