gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r20522 - gnunet/src/gns


From: gnunet
Subject: [GNUnet-SVN] r20522 - gnunet/src/gns
Date: Thu, 15 Mar 2012 13:53:04 +0100

Author: schanzen
Date: 2012-03-15 13:53:04 +0100 (Thu, 15 Mar 2012)
New Revision: 20522

Modified:
   gnunet/src/gns/gnunet-service-gns_resolver.c
Log:
-fix leaks


Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c        2012-03-15 12:46:12 UTC 
(rev 20521)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c        2012-03-15 12:53:04 UTC 
(rev 20522)
@@ -629,6 +629,9 @@
                rh->name);
     /* give up, cannot resolve */
     rlh->proc(rlh->proc_cls, 0, NULL);
+    GNUNET_free(rlh->name);
+    GNUNET_free(rlh);
+    free_resolver_handle(rh);
     return;
   }
 
@@ -636,6 +639,9 @@
   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
              "Record resolved from DHT!");
   rlh->proc(rlh->proc_cls, rd_count, rd);
+  GNUNET_free(rlh->name);
+  GNUNET_free(rlh);
+  free_resolver_handle(rh);
 
 }
 
@@ -668,6 +674,9 @@
     }
     /* give up, cannot resolve */
     rlh->proc(rlh->proc_cls, 0, NULL);
+    GNUNET_free(rlh->name);
+    GNUNET_free(rlh);
+    free_resolver_handle(rh);
     return;
   }
 
@@ -675,6 +684,9 @@
   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
              "Record resolved from namestore!");
   rlh->proc(rlh->proc_cls, rd_count, rd);
+  GNUNET_free(rlh->name);
+  GNUNET_free(rlh);
+  free_resolver_handle(rh);
 
 }
 
@@ -778,6 +790,9 @@
              "Cannot fully resolve delegation for %s via DHT!\n",
              rh->name);
   rlh->proc(rlh->proc_cls, 0, NULL);
+  GNUNET_free(rlh->name);
+  GNUNET_free(rlh);
+  free_resolver_handle(rh);
 }
 
 
@@ -1099,7 +1114,9 @@
   rh->authority_chain_head->zone = zone;
 
   rlh->record_type = record_type;
-  rlh->name = (char*)name; //FIXME
+  rlh->name = GNUNET_malloc(strlen(name) + 1);
+  memset(rlh->name, 0, strlen(name) + 1);
+  strcpy(rlh->name, name); //FIXME
   rlh->proc = proc;
   rlh->proc_cls = cls;
 
@@ -1157,6 +1174,7 @@
                "Sending shorten result %s\n", result);
 
     nsh->proc(nsh->proc_cls, result);
+    GNUNET_free(nsh);
     free_resolver_handle(rh);
     GNUNET_free(result);
   }
@@ -1175,6 +1193,7 @@
                "Our zone: Sending name as shorten result %s\n", rh->name);
     
     nsh->proc(nsh->proc_cls, result);
+    GNUNET_free(nsh);
     free_resolver_handle(rh);
     GNUNET_free(result);
   }
@@ -1259,6 +1278,7 @@
                "Our zone: Sending name as shorten result %s\n", rh->name);
     
     nsh->proc(nsh->proc_cls, result);
+    GNUNET_free(nsh);
     free_resolver_handle(rh);
     GNUNET_free(result);
     return;
@@ -1378,17 +1398,19 @@
                "Got authority result %s\n", result);
     
     nah->proc(nah->proc_cls, result);
+    GNUNET_free(nah->name);
+    GNUNET_free(nah);
     free_resolver_handle(rh);
     GNUNET_free(result);
-    GNUNET_free(nah);
   }
   else
   {
     GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
                "Unable to resolve authority for remaining %s!\n", rh->name);
     nah->proc(nah->proc_cls, "");
+    GNUNET_free(nah->name);
+    GNUNET_free(nah);
     free_resolver_handle(rh);
-    GNUNET_free(nah);
   }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]