Parse on a copy of the argument string for printer

If done on original the wrong backend is loaded on autoreconnect

(cherry picked from commit af1c6ebcb4)
This commit is contained in:
akallabeth 2021-03-04 14:26:35 +01:00 committed by akallabeth
parent 73b37791cd
commit 9ce4bc351f

View File

@ -979,7 +979,7 @@ printer_DeviceServiceEntry
device = (RDPDR_PRINTER*)pEntryPoints->device;
name = device->Name;
driver_name = device->DriverName;
driver_name = _strdup(device->DriverName);
/* Secondary argument is one of the following:
*
@ -1016,7 +1016,8 @@ printer_DeviceServiceEntry
if (!driver)
{
WLog_ERR(TAG, "Could not get a printer driver!");
return CHANNEL_RC_INITIALIZATION_ERROR;
error = CHANNEL_RC_INITIALIZATION_ERROR;
goto fail;
}
if (name && name[0])
@ -1064,7 +1065,9 @@ printer_DeviceServiceEntry
}
fail:
driver->ReleaseRef(driver);
free(driver_name);
if (driver)
driver->ReleaseRef(driver);
return error;
}