freecwmp
[Top] [All Lists]

[PATCH 1/2] fix a memory leak in parse_inform_response_message

To: freecwmp@linux-mips.org
Subject: [PATCH 1/2] fix a memory leak in parse_inform_response_message
From: Jonas Gorski <jonas.gorski@gmail.com>
Date: Tue, 24 Jul 2012 16:44:12 +0200
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=hIvF5pL19iJruntkSy8z3gUPYNWdJ+IQHQDUxj3T7Iw=; b=JMXhbWW/itSabe1BJ0HkkkB+rsdE5dVGKFbYVt/7nSCkwnEvRn+UztAh4Dt9YLn84b JavH3pHHB2f3byr7970THT5/mQS7DQVlN8voyUzhfAr2P/2usJUyMBUJYdfvpMVLFXAj xU+8j2bmH1NHgI2ipS6qzwY0OHfogbez3DJ4ANZj1977SdOtY/7gBkLkhC6PFDKyxeZT 4lsL5AVolOEe14USnRU69kZPXVaK9nE4lq/9YWZL2aLVViB4mIZXSCdH/FnpD+WMU7kQ CS+LiAvWkNeFZWdvB9rpUK34kuH2AevfhwBIdAViU9NSoTO+1FZ9N9R/n6FEEzMOrEsc lFhg==
Original-recipient: rfc822;freecwmp@linux-mips.org
Sender: freecwmp-bounce@linux-mips.org
When receiving a soap fault freecwmp leaks soap_fault_env.

Contributed by T-Labs, Deutsche Telekom Innovation Laboratories

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 src/xml/xml.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xml/xml.c b/src/xml/xml.c
index 99f010c..38f8583 100644
--- a/src/xml/xml.c
+++ b/src/xml/xml.c
@@ -355,10 +355,10 @@ xml_parse_inform_response_message(char *msg_in, char 
**msg_out)
        snprintf(soap_env_fault, (len + 1), "%s:%s\0", ns.soap_env, "Fault");
 
        busy_node = mxmlFindElement(tree, tree, soap_env_fault, NULL, NULL, 
MXML_DESCEND);
+       free(soap_env_fault);
        // TODO: ACS responded with error message, right now we are not 
handeling this
        if (busy_node)
                goto error;
-       free(soap_env_fault);
 
        busy_node = mxmlFindElement(tree, tree, "MaxEnvelopes", NULL, NULL, 
MXML_DESCEND);
        if (!busy_node)
-- 
1.7.10


<Prev in Thread] Current Thread [Next in Thread>