Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unix_putenv leaks memory #4697

vicuna opened this issue Jan 19, 2009 · 1 comment


None yet
1 participant
Copy link

commented Jan 19, 2009

Original bug ID: 4697
Reporter: Christoph Bauer
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.0
Fixed in version: 3.12.1+dev
Category: ~DO NOT USE (was: OCaml general)

Bug description

The function unix_putenv() allocates memory. It is never freed.

Maybe at least in the error case (putenv() == -1), the memory should be freed.
Or better (if portable): setenv() could be used.


This comment has been minimized.

Copy link

commented Sep 12, 2011

Comment author: @xclerc

The memory is now freed in the error case,
but one should not free it upon successful
call (as specified by the standard).

@vicuna vicuna closed this Sep 25, 2012

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.