Skip to content

Commit f8554b4

Browse files
authored
Fix memory leaks in Connection_getPrinterAttributes (Resolves #44) (#64)
1 parent e5acbd8 commit f8554b4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cupsconnection.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3393,13 +3393,14 @@ Connection_getPrinterAttributes (Connection *self, PyObject *args,
33933393
} else {
33943394
PyObject *val = PyObject_from_attr_value (attr, i);
33953395
PyDict_SetItemString (ret, ippGetName (attr), val);
3396+
Py_XDECREF (val);
33963397
}
33973398
}
33983399

33993400
if (!attr)
34003401
break;
34013402
}
3402-
3403+
ippDelete (answer);
34033404
debugprintf ("<- Connection_getPrinterAttributes() = dict\n");
34043405
return ret;
34053406
}

0 commit comments

Comments
 (0)