UpnpRegisterRootDevice函数返回-104

void *Cookie = NULL;
UpnpDevice_Handle DeviceHandle = -1;
char desc_doc_url[MAX_BUF_LEN] = {0};
snprintf(desc_doc_url, MAX_BUF_LEN, "http://%s:%d/%s", IP, PORT, "tvdevicedesc.xml");

iRet = UpnpRegisterRootDevice(desc_doc_url, TvDeviceCallbackEventHandler, Cookie, &DeviceHandle);
if(iRet != UPNP_E_SUCCESS)
{
    printf("Error register root device %d\n", iRet);
    UpnpFinish();
    return iRet;
}

我也不清楚是我的参数传的有问题,还是有什么没初始化,一直返回-104,请各位大神指点

http://manual.freeshell.org/libupnp-1.6.18/html/upnp/UpnpRegisterRootDevice.html
先查看对应的错误信息。

UPNP_E_OUTOF_MEMORY: There are insufficient resources to register this root device,就是这个错误,我跟进upnp的代码调了一下,他在里面的栈上分配了很大一块内存,分配的大小是一个很大的整数,根本不能分配成功,所以就报内存不够的错误,为什么会这样呢?