connexion leak in cupsext / getPrinters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HPLIP |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
cupsext / getPrinters leaks a server connection on each call :
Ex:
% strace -f -e trace=connect python
Python 2.7.3 (default, Jan 2 2013, 16:53:07)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cupsext, os
>>> os.listdir(
['0', '1', '2', '3']
>>> cupsext.
connect(4, {sa_family=AF_FILE, path="/
[<cupsext.Printer object at 0xf7477750>, <cupsext.Printer object at 0xf74777f0>, <cupsext.Printer object at 0xf7477868>, <cupsext.Printer object at 0xf7477890>]
>>> os.listdir(
['0', '1', '2', '3', '4', '5']
>>> cupsext.
connect(5, {sa_family=AF_FILE, path="/
[<cupsext.Printer object at 0xf7477778>, <cupsext.Printer object at 0xf7477980>, <cupsext.Printer object at 0xf74779f8>, <cupsext.Printer object at 0xf7477a20>]
>>> os.listdir(
['0', '1', '2', '3', '4', '5', '6']
>>> cupsext.
connect(6, {sa_family=AF_FILE, path="/
[<cupsext.Printer object at 0xf7477908>, <cupsext.Printer object at 0xf7477b10>, <cupsext.Printer object at 0xf7477b88>, <cupsext.Printer object at 0xf7477bb0>]
>>> os.listdir(
['0', '1', '2', '3', '4', '5', '6', '7']
>>> cupsext.
connect(7, {sa_family=AF_FILE, path="/
[<cupsext.Printer object at 0xf7477a98>, <cupsext.Printer object at 0xf7477ca0>, <cupsext.Printer object at 0xf7477d18>, <cupsext.Printer object at 0xf7477d40>]
>>> os.listdir(
['0', '1', '2', '3', '4', '5', '6', '7', '8']
Seems like the same bug was corrected in getPPDList : return before abort label has been commented to let cleanup happens anyway.
Proposing the following 1-liner patch, applying the same solution to getPrinters :
--- cupsext.c 2013-05-13 11:44:36.147287706 +0200
+++ cupsext.c.mod 2013-05-13 11:45:17.215488498 +0200
@@ -448,7 +448,7 @@
}
- return printer_list;
+ //return printer_list;
}
abort:
if ( response != NULL )
Related branches
Changed in hplip: | |
status: | New → Confirmed |
Changed in hplip: | |
status: | Confirmed → Fix Committed |
Changed in hplip: | |
status: | Fix Committed → Fix Released |