-fix uninit and fix leak
[oweals/gnunet.git] / src / gns / gnunet-service-gns_resolver.c
index f3040749a5f8b76806586f1b8dd6cacea8cab4bc..2cde3e37eb25a14f2d06600e846aaf7a1712d46a 100644 (file)
@@ -300,12 +300,13 @@ process_pseu_lookup_ns (void* cls,
   new_pkey.flags = GNUNET_NAMESTORE_RF_AUTHORITY
                  | GNUNET_NAMESTORE_RF_PRIVATE
                  | GNUNET_NAMESTORE_RF_PENDING;
-  gph->namestore_task = GNUNET_NAMESTORE_record_create (namestore_handle,
-                                                       gph->key,
-                                                       gph->test_name,
-                                                       &new_pkey,
-                                                       &create_pkey_cont, 
-                                                       gph);
+  gph->namestore_task = GNUNET_NAMESTORE_record_put_by_authority (namestore_handle,
+                                                                 gph->key,
+                                                                 gph->test_name,
+                                                                 1,
+                                                                 &new_pkey,
+                                                                 &create_pkey_cont, 
+                                                                 gph);
 }
 
 
@@ -1529,6 +1530,7 @@ read_dns_response (void *cls,
       npacket.queries = &query;
       npacket.answers = NULL;
       npacket.authority_records = NULL;
+      npacket.additional_records = NULL;
       npacket.num_queries = 1;
       npacket.num_answers = 0;
       npacket.num_authority_records = 0;
@@ -1547,6 +1549,7 @@ read_dns_response (void *cls,
                    rh->id);
        GNUNET_NETWORK_socket_close (rh->dns_sock);
        finish_lookup (rh, rlh, 0, NULL);
+       GNUNET_DNSPARSER_free_packet (packet);
        return;
       }
       continue;