8 Jan
2009
8 Jan
'09
6:45 p.m.
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.