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

unix_putenv leaks memory #4697

vicuna opened this issue Jan 19, 2009 · 1 comment


Copy link

@vicuna vicuna 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.

Copy link

@vicuna vicuna 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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant