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]

Should unsetenv() free?


I'm sorry for the stupid question, but I'm newbie with newlib.

I'm using environment functionalities of newlib and I noticed setenv() calls malloc/realloc to increase the array of pointers (that point to the "<variable>=<value>" strings) and calls malloc to allocate the "<variable>=<value>" string of the just added variable.

So why doesn't unsetenv call free? It seems to me that it only deletes the pointer in the environment array, but it doesn't free the string.



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