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

[PATCH] [cups-2.1] cupsConnectDest(): addrlist is leaking after successful httpConnect2() #4634

Closed
michaelrsweet opened this issue May 23, 2015 · 3 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 2.0-current
CUPS.org User: lebedevri

I was working on fixing all memleaks i can in darktable, and i found this:

Direct leak of 12808 byte(s) in 1 object(s) allocated from:
#0 0x7ffb35bc4895 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54895)
#1 0x7ffb2e58073c (/usr/lib/x86_64-linux-gnu/libcups.so.2+0x3073c)
#2 0x7ffb2e5834f0 in httpConnect2 (/usr/lib/x86_64-linux-gnu/libcups.so.2+0x334f0)
#3 0x7ffb2e5739df in cupsConnectDest (/usr/lib/x86_64-linux-gnu/libcups.so.2+0x239df)
...

That happens even if the http_t* returned from cupsConnectDest() is correctly passed to httpClose().

I have checkout most recent git version:
http://www.cups.org/cups.git cups-2.1,
commit cab9f68
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12659 a1ca3aef-8c08-0410-bb20-df032aa958be

And looks like that the issue is still there, so i have prepared a patch.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: lebedevri

Patch did not attach the first time, retrying.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"0001-cupsConnectDest-do-not-leak-addrlist-after-successfu.patch":

From 3d33c5927493c867f4fb64c34ef4899dc71dbc7d Mon Sep 17 00:00:00 2001
From: Roman Lebedev lebedev.ri@gmail.com
Date: Sat, 23 May 2015 17:34:49 +0300
Subject: [PATCH] cupsConnectDest(): do not leak addrlist after successful
httpConnect2()


cups/dest.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/cups/dest.c b/cups/dest.c
index cbccd66..d6961aa 100644
--- a/cups/dest.c
+++ b/cups/dest.c
@@ -658,6 +658,8 @@ cupsConnectDest(
http = httpConnect2(hostname, port, addrlist, AF_UNSPEC, encryption, 1, 0,
NULL);

  • httpAddrFreeList(addrlist);

/*

  • Connect if requested...
    */

    2.1.4

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