[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r4206 - trunk/OpenDNSSEC/enforcer/utils

Rickard Bellgrim rickard.bellgrim at iis.se
Tue Nov 23 10:56:27 CET 2010


Author: rb
Date: 2010-11-23 10:56:27 +0100 (Tue, 23 Nov 2010)
New Revision: 4206

Modified:
   trunk/OpenDNSSEC/enforcer/utils/ksmutil.c
Log:
memleak


Modified: trunk/OpenDNSSEC/enforcer/utils/ksmutil.c
===================================================================
--- trunk/OpenDNSSEC/enforcer/utils/ksmutil.c	2010-11-23 09:53:09 UTC (rev 4205)
+++ trunk/OpenDNSSEC/enforcer/utils/ksmutil.c	2010-11-23 09:56:27 UTC (rev 4206)
@@ -5514,6 +5514,8 @@
     xmlNodePtr root;
     xmlNodePtr cur;
     xmlNodePtr pol;
+    xmlChar *polChar = NULL;
+    xmlChar *propChar = NULL;
 
     int temp_id;
     int i = 0;
@@ -5540,10 +5542,12 @@
     for(cur = root->children; cur != NULL; cur = cur->next)
     {
         if (xmlStrcmp( cur->name, (const xmlChar *)"Zone") == 0) {
-            printf("Found Zone: %s", xmlGetProp(cur, (xmlChar *) "name"));
+            propChar = xmlGetProp(cur, (xmlChar *) "name");
+            printf("Found Zone: %s", propChar);
 
             /* make a note of the zone_id */
-            status = KsmZoneIdFromName((char *) xmlGetProp(cur, (xmlChar *) "name"), &temp_id);
+            status = KsmZoneIdFromName((char *) propChar, &temp_id);
+            xmlFree(propChar);
             if (status != 0) {
                 printf(" (zone not in database)");
                 zone_ids[i] = 0;
@@ -5557,7 +5561,9 @@
             {
                 if (xmlStrcmp( pol->name, (const xmlChar *)"Policy") == 0)
                 {
-                    printf("; on policy %s\n", xmlNodeGetContent(pol));
+                    polChar = xmlNodeGetContent(pol);
+                    printf("; on policy %s\n", polChar);
+                    xmlFree(polChar);
                 }
             }
         }




More information about the Opendnssec-commits mailing list