From a15e0c99d75e166dc458288281bad130dfb0b16f Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Sun, 22 Aug 2010 11:32:09 +0000 Subject: [PATCH] * upnp/src/api/Discovery.c: Fix a serious bug and memory leak in UpnpDiscovery_strcpy_DeviceType(). Thanks to David Blanchet for the patch. git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@584 119443c7-1b9e-41f8-b6fc-b9c35fce742c --- ChangeLog | 5 +++++ THANKS | 1 + upnp/src/api/Discovery.c | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd0f3c1..5cd45c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ Version 1.8.0 ******************************************************************************* +2010-08-22 Marcelo Jimenez + * upnp/src/api/Discovery.c: Fix a serious bug and memory leak in + UpnpDiscovery_strcpy_DeviceType(). Thanks to David Blanchet for the + patch. + 2010-04-25 Marcelo Jimenez Separation of the ClientSubscription object. diff --git a/THANKS b/THANKS index 7054191..013865b 100644 --- a/THANKS +++ b/THANKS @@ -18,6 +18,7 @@ exempt of errors. - Chris Pickel - Chuck Thomason (cyt4) - Craig Nelson +- David Blanchet - David Maass - Emil Ljungdahl - Erik Johansson diff --git a/upnp/src/api/Discovery.c b/upnp/src/api/Discovery.c index c971604..7be48f8 100644 --- a/upnp/src/api/Discovery.c +++ b/upnp/src/api/Discovery.c @@ -197,9 +197,9 @@ void UpnpDiscovery_set_DeviceType(UpnpDiscovery *p, const UpnpString *s) void UpnpDiscovery_strcpy_DeviceType(UpnpDiscovery *p, const char *s) { - UpnpString_delete(((struct SUpnpDiscovery *)p)->m_deviceID); - ((struct SUpnpDiscovery *)p)->m_deviceID = UpnpString_new(); - UpnpString_set_String(((struct SUpnpDiscovery *)p)->m_deviceID, s); + UpnpString_delete(((struct SUpnpDiscovery *)p)->m_deviceType); + ((struct SUpnpDiscovery *)p)->m_deviceType = UpnpString_new(); + UpnpString_set_String(((struct SUpnpDiscovery *)p)->m_deviceType, s); }