Avoid trying to disconnect a neighbour twice
[oweals/gnunet.git] / src / transport / plugin_transport_smtp.c
index 740d25d00ea6c217b5f15b0396c75c39ca3b9b71..5b966bf61aafa575d8d81478b23c8491571a051b 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet
-     (C) 2003, 2004, 2005, 2006, 2007 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2003-2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -233,7 +233,7 @@ listenAndDistribute (void *unused)
       }
       if (stats != NULL)
         stats->change (stat_bytesReceived, size);
-      coreMP = GNUNET_malloc (sizeof (GNUNET_TransportPacket));
+      coreMP = GNUNET_new (GNUNET_TransportPacket);
       coreMP->msg = out;
       coreMP->size = size - sizeof (SMTPMessage);
       coreMP->tsession = NULL;
@@ -541,7 +541,7 @@ api_connect (const GNUNET_MessageHello * hello, GNUNET_TSession ** tsessionPtr,
 {
   GNUNET_TSession *tsession;
 
-  tsession = GNUNET_malloc (sizeof (GNUNET_TSession));
+  tsession = GNUNET_new (GNUNET_TSession);
   tsession->internal = GNUNET_malloc (GNUNET_sizeof_hello (hello));
   tsession->peer = hello->senderIdentity;
   memcpy (tsession->internal, hello, GNUNET_sizeof_hello (hello));