From: Christian Grothoff Date: Thu, 28 Apr 2011 20:26:18 +0000 (+0000) Subject: fixing leak X-Git-Tag: initial-import-from-subversion-38251~18581 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=81b94ec02de91fbdc1bcf31ae64e89f907d77227;p=oweals%2Fgnunet.git fixing leak --- diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c index 15dd4897a..11b26c452 100644 --- a/src/fs/gnunet-service-fs_lc.c +++ b/src/fs/gnunet-service-fs_lc.c @@ -263,13 +263,17 @@ client_response_handler (void *cls, 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",