device_inject: possible memory leak