From: Christian Grothoff Date: Thu, 12 Nov 2009 16:22:28 +0000 (+0000) Subject: fixing use-after-free X-Git-Tag: initial-import-from-subversion-38251~23103 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a483f8400acc637bc7dcb3dd0177702a641af5e7;p=oweals%2Fgnunet.git fixing use-after-free --- diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index bef03a45e..46b342cab 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c @@ -1529,7 +1529,6 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, &sk, &iv, &sb_enc[1]); - GNUNET_free (sb); sb_enc->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_SBLOCK); sb_enc->purpose.size = htonl(slen + mdsize + nidlen + sizeof(struct SBlock) @@ -1545,6 +1544,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, if (0 != (options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) { GNUNET_free (sb_enc); + GNUNET_free (sb); sb_put_cont (psc, GNUNET_OK, NULL); @@ -1554,6 +1554,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, if (NULL == psc->dsh) { GNUNET_free (sb_enc); + GNUNET_free (sb); sb_put_cont (psc, GNUNET_NO, _("Failed to connect to datastore.")); @@ -1572,6 +1573,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, GNUNET_CONSTANTS_SERVICE_TIMEOUT, &sb_put_cont, psc); + GNUNET_free (sb); GNUNET_free (sb_enc); }