Right now _WdfDeviceInitAssignName is holding on to the driver supplied name and saves it as device_name. However, the device_name buffer supplied to this routine may be freed after the call to _WdfDeviceInitAssignName (or subsequent call to _WdfDeviceCreate) since it's owned by the caller. A deep copy of the supplied device_name would mitigate this use-after-free issue.