From 4510b4d123a4f62c49c55fa517f15df4fa90ebec Mon Sep 17 00:00:00 2001 From: Denis Loh Date: Fri, 30 Oct 2009 18:30:57 +0100 Subject: Fixed memory leak with device description --- server/server.cpp | 2 +- upnpcomponents/dlna.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/server.cpp b/server/server.cpp index feebcb1..03750bd 100644 --- a/server/server.cpp +++ b/server/server.cpp @@ -118,7 +118,7 @@ bool cUPnPServer::init(void){ //register media server device to SDK cString URLBase = cString::sprintf("http://%s:%d", UpnpGetServerIpAddress(), UpnpGetServerPort()); - this->mDeviceDescription = cDlna::getInstance()->getDeviceDescription(URLBase); + this->mDeviceDescription = cString(cDlna::getInstance()->getDeviceDescription(URLBase),true); MESSAGE("Register Media Server Device"); ret = UpnpRegisterRootDevice2(UPNPREG_BUF_DESC, diff --git a/upnpcomponents/dlna.cpp b/upnpcomponents/dlna.cpp index 0b15cbe..eaa23c1 100644 --- a/upnpcomponents/dlna.cpp +++ b/upnpcomponents/dlna.cpp @@ -232,5 +232,5 @@ const char* cDlna::getDeviceDescription(const char* URLBase){ // UPNP_AVT_CONTROL_URL, // UPnP AVT Control URL // UPNP_AVT_EVENT_URL // UPnP AVT Event URL ); - return description; + return strdup0(*description); } \ No newline at end of file -- cgit v1.2.3