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

Memory leak on cygwin platform #116

Open
GoogleCodeExporter opened this issue May 26, 2015 · 0 comments
Open

Memory leak on cygwin platform #116

GoogleCodeExporter opened this issue May 26, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

1. What version of distcc are you using (e.g. "2.7.1")?  

svn checkout http://distcc.googlecode.com/svn/trunk/ distcc-read-only
Go through source code and find some possible memory leak on cygwin platform.

2. What platform are you running on (e.g. "Red Hat 8.0", "HP-UX 11.11")?  What 
compilare are you using ("gcc 3.3")?  

bjcheny@bjcheny-work ~
$ uname -a
CYGWIN_NT-5.1 bjcheny-work 1.7.15(0.260/5/3) 2012-05-09 10:25 i686 Cygwin
bjcheny@bjcheny-work ~
$ cc --version
cc (GCC) 4.5.3

3. What were you trying to do (e.g. "install distcc", "build Mozilla")?

Study source code of distcc and build it on cygwin platform.

4. What went wrong?  Did you get an error message, did it hang, did it build a 
program that didn't work, did it not distribute compilation to machines that 
ought to get it?

In int dcc_get_tmp_top(const char **p_ret) in tempfile.c, the below code may 
have issue of memory leak on cygwin platform:

    char *s = malloc(MAXPATHLEN+1);
    GetTempPath(MAXPATHLEN+1,s);
    if ((ret = dcc_add_cleanup(s))) {
        free(s);
        return ret;
    }
    *p_ret = s;

The logic for cygwin is a little bit different from that on linux. 
It requires to malloc buffer as "s" to save result from w32 API GetTempPath().
However, no free action after return buffer of s, on cygwin platform.

Btw, I wonder this kind of issue in code should be put here or groups of 
patches. Let me know. Thanks.

Original issue reported on code.google.com by compan...@gmail.com on 11 Aug 2012 at 8:17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant