localspl: Fix error handling in printer_alloc_handle helper.

This commit is contained in:
Piotr Caban 2022-12-01 13:42:28 +01:00 committed by Alexandre Julliard
parent e09c93de7b
commit 5954a7f3cd

View file

@ -1573,9 +1573,10 @@ static HANDLE printer_alloc_handle(LPCWSTR name, LPPRINTER_DEFAULTSW pDefault)
/* clone the full name */
printer->name = wcsdup(name);
if (name && (!printer->name)) {
if (name && !printer->name) {
printer_free(printer);
printer = NULL;
goto end;
}
if (printername) {
len = ARRAY_SIZE(L",XcvMonitor ") - 1;