diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-11-12 16:22:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-11-12 16:22:28 +0000 |
commit | a483f8400acc637bc7dcb3dd0177702a641af5e7 (patch) | |
tree | 09eb9d66cc55e92c914f4bbfd2e1902ff62efac3 /src/fs | |
parent | 4c776c7ec791ad75d9413f5ae098e9e200fd9d07 (diff) | |
download | gnunet-a483f8400acc637bc7dcb3dd0177702a641af5e7.tar.gz gnunet-a483f8400acc637bc7dcb3dd0177702a641af5e7.zip |
fixing use-after-free
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs_publish.c | 4 |
1 files changed, 3 insertions, 1 deletions
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, | |||
1529 | &sk, | 1529 | &sk, |
1530 | &iv, | 1530 | &iv, |
1531 | &sb_enc[1]); | 1531 | &sb_enc[1]); |
1532 | GNUNET_free (sb); | ||
1533 | sb_enc->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_SBLOCK); | 1532 | sb_enc->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_SBLOCK); |
1534 | sb_enc->purpose.size = htonl(slen + mdsize + nidlen | 1533 | sb_enc->purpose.size = htonl(slen + mdsize + nidlen |
1535 | + sizeof(struct SBlock) | 1534 | + sizeof(struct SBlock) |
@@ -1545,6 +1544,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
1545 | if (0 != (options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) | 1544 | if (0 != (options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) |
1546 | { | 1545 | { |
1547 | GNUNET_free (sb_enc); | 1546 | GNUNET_free (sb_enc); |
1547 | GNUNET_free (sb); | ||
1548 | sb_put_cont (psc, | 1548 | sb_put_cont (psc, |
1549 | GNUNET_OK, | 1549 | GNUNET_OK, |
1550 | NULL); | 1550 | NULL); |
@@ -1554,6 +1554,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
1554 | if (NULL == psc->dsh) | 1554 | if (NULL == psc->dsh) |
1555 | { | 1555 | { |
1556 | GNUNET_free (sb_enc); | 1556 | GNUNET_free (sb_enc); |
1557 | GNUNET_free (sb); | ||
1557 | sb_put_cont (psc, | 1558 | sb_put_cont (psc, |
1558 | GNUNET_NO, | 1559 | GNUNET_NO, |
1559 | _("Failed to connect to datastore.")); | 1560 | _("Failed to connect to datastore.")); |
@@ -1572,6 +1573,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
1572 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, | 1573 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, |
1573 | &sb_put_cont, | 1574 | &sb_put_cont, |
1574 | psc); | 1575 | psc); |
1576 | GNUNET_free (sb); | ||
1575 | GNUNET_free (sb_enc); | 1577 | GNUNET_free (sb_enc); |
1576 | } | 1578 | } |
1577 | 1579 | ||