This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
clearenv for newlib
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: Newlib Mailing List <newlib at sourceware dot org>
- Date: Fri, 14 Sep 2007 10:41:51 -0500
- Subject: clearenv for newlib
Hi,
I am porting a library to RTEMS that is calling clearenv().
I am willing to implement one for newlib. Is this a
method OK for newlib to have?
I was looking at the current environ code to gauge the
difficulty and noticed that unsetenv() does not free
any memory. Since putenv calls strdup(), I wonder
if this is right.
grep free libc/stdlib/*env*
libc/stdlib/putenv_r.c: (void) _free_r (reent_ptr, p);
libc/stdlib/putenv_r.c: (void) _free_r (reent_ptr, p);
Those are error paths. Is this a leak?
--joel