fix div by zero
[oweals/gnunet.git] / src / transport / plugin_transport_udp.c
index 1ff962544f2d226122f9cdbe186b4c7f5f3e9e6f..abbcca2aee2a3bd2dea420313501c6d87d95520a 100644 (file)
@@ -2,20 +2,18 @@
  This file is part of GNUnet
  Copyright (C) 2010-2017 GNUnet e.V.
 
- GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
+ GNUnet is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License,
+ or (at your option) any later version.
 
  GNUnet is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- General Public License for more details.
Affero General Public License for more details.
 
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING.  If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ You should have received a copy of the GNU Affero General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /**
@@ -1631,6 +1629,7 @@ enqueue (struct Plugin *plugin,
   if (GNUNET_YES == session->in_destroy)
   {
     GNUNET_break (0);
+    GNUNET_free (udpw);
     return;
   }
   if (plugin->bytes_in_buffer > INT64_MAX - udpw->msg_size)
@@ -1913,8 +1912,8 @@ enqueue_fragment (void *cls,
   udpw->qc = &qc_fragment_sent;
   udpw->qc_cls = plugin;
   GNUNET_memcpy (udpw->msg_buf,
-          msg,
-          msg_len);
+                msg,
+                msg_len);
   enqueue (plugin,
            udpw);
   if (session->address->address_length == sizeof (struct IPv4UdpAddress))
@@ -3838,9 +3837,9 @@ libgnunet_plugin_transport_udp_init (void *cls)
   unsigned long long port;
   unsigned long long aport;
   unsigned long long udp_max_bps;
-  unsigned long long enable_v6;
-  unsigned long long enable_broadcasting;
-  unsigned long long enable_broadcasting_recv;
+  int enable_v6;
+  int enable_broadcasting;
+  int enable_broadcasting_recv;
   char *bind4_address;
   char *bind6_address;
   struct GNUNET_TIME_Relative interval;