Skip to content

Commit

Permalink
2007-12-11 Tim Waugh <[email protected]>
Browse files Browse the repository at this point in the history
        * cupsppd.c (Option_getChoices): Don't leak Unicode objects.

git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pycups/trunk@263 e7545f15-59ab-4934-8816-61942c173d0f
  • Loading branch information
twaugh committed Dec 11, 2007
1 parent 5b5858b commit 56957d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2007-12-11 Tim Waugh <[email protected]>

* cupsppd.c (Option_getChoices): Don't leak Unicode objects.

2007-11-30 Tim Waugh <[email protected]>

* cupsconnection.c (do_printer_request): Fixed debugging output.
Expand Down
16 changes: 10 additions & 6 deletions cupsppd.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,12 +833,16 @@ Option_getChoices (Option *self, void *closure)
i < self->option->num_choices;
i++, choice++) {
PyObject *choice_dict = PyDict_New ();
PyDict_SetItemString (choice_dict, "choice",
make_PyUnicode_from_ppd_string (self->ppd,
choice->choice));
PyDict_SetItemString (choice_dict, "text",
make_PyUnicode_from_ppd_string (self->ppd,
choice->text));
PyObject *u;

u = make_PyUnicode_from_ppd_string (self->ppd, choice->choice);
PyDict_SetItemString (choice_dict, "choice", u);
Py_DECREF (u);

u = make_PyUnicode_from_ppd_string (self->ppd, choice->text);
PyDict_SetItemString (choice_dict, "text", u);
Py_DECREF (u);

PyList_Append (choices, choice_dict);
if (!strcmp (choice->choice, self->option->defchoice))
defchoice_seen = true;
Expand Down

0 comments on commit 56957d6

Please sign in to comment.