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 076f8e5be6)
This commit is contained in:
Fabrice Fontaine 2012-02-28 14:09:08 +01:00 committed by Marcelo Roberto Jimenez
parent 9125d82010
commit b441c6f4a8
2 changed files with 12 additions and 0 deletions

View File

@ -299,6 +299,16 @@ Version 1.8.0
Version 1.6.16
*******************************************************************************
2012-02-28 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
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 <fabrice.fontaine(at)orange.com>
SF Bug Tracker id 3494865 - Use of non-initialized variable in parser_parse_requestline

View File

@ -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;