-coverity
authorMartin Schanzenbach <mschanzenbach@posteo.de>
Thu, 6 Sep 2012 16:41:48 +0000 (16:41 +0000)
committerMartin Schanzenbach <mschanzenbach@posteo.de>
Thu, 6 Sep 2012 16:41:48 +0000 (16:41 +0000)
src/gns/gnunet-gns-proxy.c
src/gns/gnunet-gns.c
src/gns/test_gns_simple_lookup.c

index 67da4a23b04bb20c80860b8032c31ba8fc1628d2..cdc18e3f6b156ca8bfab88ffcf423f4ce292c10a 100644 (file)
@@ -587,6 +587,7 @@ con_post_data_iter (void *cls,
     memcpy (new_value, pdata->value, pdata->total_bytes);
     memcpy (new_value+off, data, size);
     GNUNET_free (pdata->value);
+    pdata->value = new_value;
     pdata->total_bytes += size;
 
     return MHD_YES;
@@ -2109,11 +2110,11 @@ create_response (void *cls,
     {
       if (GNUNET_YES == ctask->is_httppost)
       {
-        i = 0;
         for (upload_data_iter = ctask->upload_data_head;
              NULL != upload_data_iter;
              upload_data_iter = upload_data_iter->next)
         {
+          i = 0;
           if (NULL != upload_data_iter->filename)
           {
             forms[i].option = CURLFORM_FILENAME;
index 21cc50c26c9190b539b56068efd1b277dc4e2af4..a54204283ca71a3abee0c0ca43fa543fbbdbe5e5 100644 (file)
@@ -242,7 +242,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     if (!raw)
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "No private zone key file name specified in configuration!\n");
-    shorten_key = NULL;
+    private_key = NULL;
   }
   else
   {
@@ -290,7 +290,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     return;
   }
   
-  if (NULL != shorten_name)
+  if ((NULL != shorten_name) && (NULL != shorten_zone) && (NULL != private_zone))
   {
     shorten_request = GNUNET_GNS_shorten_zone (gns, shorten_name,
                              private_zone,
index d3c96fd0b752bc7c4de9a0167ec8623d68db32c5..1e0326328314d4a1ef018edd0af5f64f279946e1 100644 (file)
@@ -186,6 +186,7 @@ do_check (void *cls,
   if (NULL == namestore_handle)
   {
     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n");
+    GNUNET_free (web);
     end_badly_now () ;
     return;
   }
@@ -195,6 +196,7 @@ do_check (void *cls,
                                                           &alice_keyfile))
   {
     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to get key from cfg\n");
+    GNUNET_free (web);
     end_badly_now () ;
     return;
   }