[PATCH] some Mac OS X fixes

Vladimir N. Oleynik dzo at simtreas.ru
Tue Feb 21 09:19:40 UTC 2006


Devin Bayer wrote:

> Your algorithm fails to take into account that environ will be  changed 
> whenever unsetenv() is called.  

Ok. You may be right.

> Nonetheless, my first  suggestion _may_ 
> not have been portable, so I used your idea to  create the attached 
> patch.  Please look it over and apply.

But:

int clearenv(void)
+{
+       extern char **environ;
+       char *var;
+
+       while((var = environ[0])) {
+               var = bb_xstrndup(var, strcspn(var,"="));
+               unsetenv(var);
+               free(var);

Hmm. I think, you call free() as double usage (from unsetenv too).


--w
vodz




More information about the busybox mailing list