From 153d71f10b694752d2f1539b1851330c042ef340 Mon Sep 17 00:00:00 2001 From: Peng Date: Wed, 15 Jan 2014 17:12:23 +0800 Subject: [PATCH] Fix memory leaks caused by DOMString members. Signed-off-by: Marcelo Roberto Jimenez --- ChangeLog | 5 +++++ upnp/inc/TemplateSource.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 42c82aa..9638791 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ Version 1.8.0 ******************************************************************************* +2014-01-15 Peng + + Fix memory leaks. + + 2013-04-27 Thijs Schreijer Renamed SCRIPTSUPPORT to IXML_HAVE_SCRIPTSUPPORT for consistency. Also diff --git a/upnp/inc/TemplateSource.h b/upnp/inc/TemplateSource.h index a4c350f..c622463 100644 --- a/upnp/inc/TemplateSource.h +++ b/upnp/inc/TemplateSource.h @@ -41,7 +41,7 @@ #define TEMPLATE_CONSTRUCTOR_LIST(MEMBER, TYPE) INIT_LIST_HEAD(&p->m_##MEMBER); #define TEMPLATE_CONSTRUCTOR_OBJECT(MEMBER, TYPE) p->m_##MEMBER = TYPE##_new(); #define TEMPLATE_CONSTRUCTOR_STRING(MEMBER) p->m_##MEMBER = UpnpString_new(); -#define TEMPLATE_CONSTRUCTOR_DOMSTRING(MEMBER) /* p->m_##MEMBER = NULL; */ +#define TEMPLATE_CONSTRUCTOR_DOMSTRING(MEMBER) p->m_##MEMBER = NULL; /******************************************************************************/ #define TEMPLATE_DESTRUCTOR_INT(MEMBER, TYPE) p->m_##MEMBER = 0; @@ -49,7 +49,7 @@ #define TEMPLATE_DESTRUCTOR_LIST(MEMBER) list_del(&p->m_##MEMBER); #define TEMPLATE_DESTRUCTOR_OBJECT(MEMBER, TYPE) TYPE##_delete(p->m_##MEMBER); p->m_##MEMBER = NULL; #define TEMPLATE_DESTRUCTOR_STRING(MEMBER) UpnpString_delete(p->m_##MEMBER); p->m_##MEMBER = NULL; -#define TEMPLATE_DESTRUCTOR_DOMSTRING(MEMBER) p->m_##MEMBER = NULL; +#define TEMPLATE_DESTRUCTOR_DOMSTRING(MEMBER) ixmlFreeDOMString(p->m_##MEMBER); p->m_##MEMBER = NULL; /******************************************************************************/ #define TEMPLATE_ASSIGNMENT(CLASS, MEMBER) ok = ok && CLASS##_set_##MEMBER(p, CLASS##_get_##MEMBER(q));