[Dovecot] v1.1.8 released
Timo Sirainen
tss at iki.fi
Thu Jan 8 18:45:06 EET 2009
On Thu, 2009-01-08 at 11:38 -0500, Dean Brooks wrote:
> I found similar code implementing unsetenv() in a perl module that
> seems to do the same thing. Completely untested, but example follows.
Hmm. Maybe I could add that to compat.c..
> void env_remove(const char *name)
> {
> int name_len;
> extern char **environ;
> char **envp;
>
> name_len = strlen(name);
> for (envp = environ; *envp != NULL; envp++) {
> if (strncmp(name, *envp, name_len) == 0 &&
> (*envp)[name_len] == '=') {
> free(*envp);
I think the free() here shouldn't be done, because Dovecot allocates the
memory from memory pools.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20090108/6cff365c/attachment.bin
More information about the dovecot
mailing list