diff options
-rw-r--r-- | source3/python/py_spoolss_printers.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source3/python/py_spoolss_printers.c b/source3/python/py_spoolss_printers.c index b0033405ad..decc52e080 100644 --- a/source3/python/py_spoolss_printers.c +++ b/source3/python/py_spoolss_printers.c @@ -52,12 +52,15 @@ PyObject *spoolss_openprinter(PyObject *self, PyObject *args, PyObject *kw) if (!(cli = open_pipe_creds(computer_name, creds, cli_spoolss_initialise, NULL))) { - fprintf(stderr, "could not initialise cli state\n"); + + /* Error state set in open_pipe_creds() */ + goto done; } if (!(mem_ctx = talloc_init())) { - fprintf(stderr, "unable to initialise talloc context\n"); + PyErr_SetString(spoolss_error, + "unable to initialise talloc context\n"); goto done; } @@ -99,11 +102,6 @@ PyObject *spoolss_closeprinter(PyObject *self, PyObject *args) result = cli_spoolss_close_printer(hnd->cli, hnd->mem_ctx, &hnd->pol); - /* Cleanup samba stuf */ - - cli_shutdown(hnd->cli); - talloc_destroy(hnd->mem_ctx); - /* Return value */ Py_INCREF(Py_None); |