This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]