gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r15110 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r15110 - gnunet/src/fs
Date: Thu, 28 Apr 2011 22:26:18 +0200

Author: grothoff
Date: 2011-04-28 22:26:18 +0200 (Thu, 28 Apr 2011)
New Revision: 15110

Modified:
   gnunet/src/fs/gnunet-service-fs_lc.c
Log:
fixing leak

Modified: gnunet/src/fs/gnunet-service-fs_lc.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_lc.c        2011-04-28 20:14:52 UTC (rev 
15109)
+++ gnunet/src/fs/gnunet-service-fs_lc.c        2011-04-28 20:26:18 UTC (rev 
15110)
@@ -263,13 +263,17 @@
   GNUNET_assert (pr == cr->pr);
   lc = cr->lc;
   msize = sizeof (struct PutMessage) + data_len;
-  pm = GNUNET_malloc (msize);
-  pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT);
-  pm->header.size = htons (msize);
-  pm->type = htonl (type);
-  pm->expiration = GNUNET_TIME_absolute_hton (expiration);
-  memcpy (&pm[1], data, data_len);      
-  GSF_local_client_transmit_ (lc, &pm->header);
+  {
+    char buf[msize];
+    
+    pm = (struct PutMessage*) buf;
+    pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT);
+    pm->header.size = htons (msize);
+    pm->type = htonl (type);
+    pm->expiration = GNUNET_TIME_absolute_hton (expiration);
+    memcpy (&pm[1], data, data_len);      
+    GSF_local_client_transmit_ (lc, &pm->header);
+  }
 #if DEBUG_FS
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Queued reply to query `%s' for local client\n",




reply via email to

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