diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-05-01 12:17:38 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-05-01 12:17:38 +0000 |
commit | f1df9f057d50cd695ee3b86538f27306ea74369f (patch) | |
tree | 403907752fd558d7072e2ba5bf654dc08370a523 /src/fs | |
parent | 470536efd23868e96a8bb7446b9a812898f90cec (diff) | |
download | gnunet-f1df9f057d50cd695ee3b86538f27306ea74369f.tar.gz gnunet-f1df9f057d50cd695ee3b86538f27306ea74369f.zip |
fixing double free, missing free, use of undef key
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs.c | 5 | ||||
-rw-r--r-- | src/fs/fs_directory.c | 3 | ||||
-rw-r--r-- | src/fs/fs_download.c | 1 | ||||
-rw-r--r-- | src/fs/fs_file_information.c | 1 |
4 files changed, 9 insertions, 1 deletions
diff --git a/src/fs/fs.c b/src/fs/fs.c index c25e1919e..94777fb05 100644 --- a/src/fs/fs.c +++ b/src/fs/fs.c | |||
@@ -663,6 +663,8 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h, | |||
663 | GNUNET_free (filename); | 663 | GNUNET_free (filename); |
664 | filename = NULL; | 664 | filename = NULL; |
665 | } | 665 | } |
666 | GNUNET_free_non_null (ksks); | ||
667 | GNUNET_free_non_null (chks); | ||
666 | return ret; | 668 | return ret; |
667 | cleanup: | 669 | cleanup: |
668 | GNUNET_free_non_null (ksks); | 670 | GNUNET_free_non_null (ksks); |
@@ -1077,6 +1079,7 @@ deserialize_publish_file (void *cls, | |||
1077 | pc->fi_pos = find_file_position (pc->fi, | 1079 | pc->fi_pos = find_file_position (pc->fi, |
1078 | fi_pos); | 1080 | fi_pos); |
1079 | GNUNET_free (fi_pos); | 1081 | GNUNET_free (fi_pos); |
1082 | fi_pos = NULL; | ||
1080 | if (pc->fi_pos == NULL) | 1083 | if (pc->fi_pos == NULL) |
1081 | { | 1084 | { |
1082 | /* failed to find position for resuming, outch! Will start from root! */ | 1085 | /* failed to find position for resuming, outch! Will start from root! */ |
@@ -1106,11 +1109,13 @@ deserialize_publish_file (void *cls, | |||
1106 | emsg); | 1109 | emsg); |
1107 | GNUNET_free (emsg); | 1110 | GNUNET_free (emsg); |
1108 | } | 1111 | } |
1112 | GNUNET_free_non_null (ns); | ||
1109 | return GNUNET_OK; | 1113 | return GNUNET_OK; |
1110 | cleanup: | 1114 | cleanup: |
1111 | GNUNET_free_non_null (pc->nid); | 1115 | GNUNET_free_non_null (pc->nid); |
1112 | GNUNET_free_non_null (pc->nuid); | 1116 | GNUNET_free_non_null (pc->nuid); |
1113 | GNUNET_free_non_null (fi_root); | 1117 | GNUNET_free_non_null (fi_root); |
1118 | GNUNET_free_non_null (fi_pos); | ||
1114 | GNUNET_free_non_null (ns); | 1119 | GNUNET_free_non_null (ns); |
1115 | if ( (rh != NULL) && | 1120 | if ( (rh != NULL) && |
1116 | (GNUNET_OK != | 1121 | (GNUNET_OK != |
diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c index e4d02b563..9c13073ab 100644 --- a/src/fs/fs_directory.c +++ b/src/fs/fs_directory.c | |||
@@ -627,6 +627,9 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, | |||
627 | "malloc"); | 627 | "malloc"); |
628 | *rsize = 0; | 628 | *rsize = 0; |
629 | *rdata = NULL; | 629 | *rdata = NULL; |
630 | GNUNET_free_non_null (sizes); | ||
631 | GNUNET_free_non_null (perm); | ||
632 | GNUNET_free_non_null (bes); | ||
630 | return GNUNET_SYSERR; | 633 | return GNUNET_SYSERR; |
631 | } | 634 | } |
632 | *rdata = data; | 635 | *rdata = data; |
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index d36c60ccc..eba58e7a5 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -313,6 +313,7 @@ schedule_block_download (struct GNUNET_FS_DownloadContext *dc, | |||
313 | block, | 313 | block, |
314 | len)) ) | 314 | len)) ) |
315 | { | 315 | { |
316 | GNUNET_CRYPTO_hash (block, len, &key); | ||
316 | if (0 == memcmp (&key, | 317 | if (0 == memcmp (&key, |
317 | &chk->key, | 318 | &chk->key, |
318 | sizeof (GNUNET_HashCode))) | 319 | sizeof (GNUNET_HashCode))) |
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index df53bcc1c..d9acc9595 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c | |||
@@ -741,7 +741,6 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, | |||
741 | &fi->client_info); | 741 | &fi->client_info); |
742 | } | 742 | } |
743 | GNUNET_free_non_null (fi->filename); | 743 | GNUNET_free_non_null (fi->filename); |
744 | GNUNET_free_non_null (fi->serialization); | ||
745 | GNUNET_free_non_null (fi->emsg); | 744 | GNUNET_free_non_null (fi->emsg); |
746 | GNUNET_free_non_null (fi->chk_uri); | 745 | GNUNET_free_non_null (fi->chk_uri); |
747 | /* clean up serialization */ | 746 | /* clean up serialization */ |