From b441c6f4a8768e8493383d799ea1f55cb5238a68 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Tue, 28 Feb 2012 14:09:08 +0100 Subject: [PATCH] SF Bug Tracker id 3495280 - Memory leak in ixmlDocument_createElementEx Submitted: Fabrice Fontaine ( ffontaine ) - 2012-02-28 04:01:02 PST There is a memory leak in ixmlDocument_createElementEx: newElement->tagName is not freed if newElement->n.nodeName = strdup(tagName); returns NULL. (cherry picked from commit 076f8e5be6e2813883f2573e3001047a6614799f) --- ChangeLog | 10 ++++++++++ ixml/src/document.c | 2 ++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index ad1a3e9..a803c0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -299,6 +299,16 @@ Version 1.8.0 Version 1.6.16 ******************************************************************************* +2012-02-28 Fabrice Fontaine + + SF Bug Tracker id 3495280 - Memory leak in ixmlDocument_createElementEx + + Submitted: Fabrice Fontaine ( ffontaine ) - 2012-02-28 04:01:02 PST + + There is a memory leak in ixmlDocument_createElementEx: + newElement->tagName is not freed if + newElement->n.nodeName = strdup(tagName); returns NULL. + 2012-02-27 Fabrice Fontaine SF Bug Tracker id 3494865 - Use of non-initialized variable in parser_parse_requestline diff --git a/ixml/src/document.c b/ixml/src/document.c index eeec48f..be98383 100644 --- a/ixml/src/document.c +++ b/ixml/src/document.c @@ -2,6 +2,7 @@ * * Copyright (c) 2000-2003 Intel Corporation * All rights reserved. + * Copyright (c) 2012 France Telecom All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -143,6 +144,7 @@ int ixmlDocument_createElementEx( newElement->n.nodeType = eELEMENT_NODE; newElement->n.nodeName = strdup(tagName); if (newElement->n.nodeName == NULL) { + free(newElement->tagName); ixmlElement_free(newElement); newElement = NULL; errCode = IXML_INSUFFICIENT_MEMORY;