Parse on a copy of the argument string for printer (#6860)

If done on original the wrong backend is loaded on autoreconnect
This commit is contained in:
akallabeth 2021-03-04 15:49:05 +01:00 committed by GitHub
parent b8bada17a8
commit d0dacf6336
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -980,7 +980,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:
*
@ -1017,7 +1017,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])
@ -1065,7 +1066,9 @@ printer_DeviceServiceEntry
}
fail:
driver->ReleaseRef(driver);
free(driver_name);
if (driver)
driver->ReleaseRef(driver);
return error;
}