yunhuizhu / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

memleaks #392

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In /memcached.c:

1516            if (dump_buf == NULL || len <= 0) {
1517                out_of_memory(c, "SERVER_ERROR Out of memory generating 
stats");
1518                return ;

dump_buf should be freed, regardless if it's considered "useful" or not.

and the same file:

4452        if ((sfd = new_socket(next)) == -1) {

since it's in a loop, overwriting 'sfd' leaks the handle.

and in daemon.c:

67    if (noclose == 0 && (fd = open("/dev/null", O_RDWR, 0)) != -1) {
'fd' is never closed :

70            return (-1);

74            return (-1);

78            return (-1);

88    return (0);

Thanks,

Original issue reported on code.google.com by MegaMan...@gmail.com on 1 Jan 2015 at 10:55