From 8c74de191c97642da1614f9bb76e9eb482404f01 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 15 Nov 2021 15:33:31 +0100 Subject: [PATCH] Fix printer reference count --- channels/printer/client/printer_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/channels/printer/client/printer_main.c b/channels/printer/client/printer_main.c index f18c953ef..cf3005344 100644 --- a/channels/printer/client/printer_main.c +++ b/channels/printer/client/printer_main.c @@ -1042,10 +1042,11 @@ printer_DeviceServiceEntry goto fail; } - if ((error = printer_register(pEntryPoints, printer))) + error = printer_register(pEntryPoints, printer); + printer->ReleaseRef(printer); + if (error) { WLog_ERR(TAG, "printer_register failed with error %" PRIu32 "!", error); - printer->ReleaseRef(printer); goto fail; } }