diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-15 13:01:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-15 13:01:56 +0000 |
commit | aa9d926aadca2a8a67ed09f9031f7652297cad44 (patch) | |
tree | 2ba1e5a7f7734dcb252f7abc28cb30765e736532 /src | |
parent | 38f32265e48027874ea93d20a74cf12d606e772e (diff) | |
download | gnunet-aa9d926aadca2a8a67ed09f9031f7652297cad44.tar.gz gnunet-aa9d926aadca2a8a67ed09f9031f7652297cad44.zip |
-check return values, fix leak
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/fs_api.c | 2 | ||||
-rw-r--r-- | src/fs/fs_download.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index 669b8cc39..42bfaed3c 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -1985,6 +1985,7 @@ deserialize_unindex_file (void *cls, const char *filename) | |||
1985 | GNUNET_break (0); | 1985 | GNUNET_break (0); |
1986 | goto cleanup; | 1986 | goto cleanup; |
1987 | } | 1987 | } |
1988 | uris = NULL; | ||
1988 | if ((GNUNET_OK != | 1989 | if ((GNUNET_OK != |
1989 | GNUNET_BIO_read_string (rh, "unindex-fn", &uc->filename, 10 * 1024)) || | 1990 | GNUNET_BIO_read_string (rh, "unindex-fn", &uc->filename, 10 * 1024)) || |
1990 | (GNUNET_OK != GNUNET_BIO_read_int64 (rh, &uc->file_size)) || | 1991 | (GNUNET_OK != GNUNET_BIO_read_int64 (rh, &uc->file_size)) || |
@@ -1994,6 +1995,7 @@ deserialize_unindex_file (void *cls, const char *filename) | |||
1994 | (GNUNET_OK != GNUNET_BIO_read_string (rh, "unindex-kskuri", &uris, 10 * 1024)) || | 1995 | (GNUNET_OK != GNUNET_BIO_read_string (rh, "unindex-kskuri", &uris, 10 * 1024)) || |
1995 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &uc->ksk_offset)) ) | 1996 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &uc->ksk_offset)) ) |
1996 | { | 1997 | { |
1998 | GNUNET_free_non_null (uris); | ||
1997 | GNUNET_break (0); | 1999 | GNUNET_break (0); |
1998 | goto cleanup; | 2000 | goto cleanup; |
1999 | } | 2001 | } |
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index f858c58bf..69298f2c9 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -2068,7 +2068,7 @@ GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, | |||
2068 | { | 2068 | { |
2069 | dc->filename = GNUNET_strdup (filename); | 2069 | dc->filename = GNUNET_strdup (filename); |
2070 | if (GNUNET_YES == GNUNET_DISK_file_test (filename)) | 2070 | if (GNUNET_YES == GNUNET_DISK_file_test (filename)) |
2071 | GNUNET_DISK_file_size (filename, &dc->old_file_size, GNUNET_YES); | 2071 | GNUNET_break (GNUNET_OK == GNUNET_DISK_file_size (filename, &dc->old_file_size, GNUNET_YES)); |
2072 | } | 2072 | } |
2073 | if (GNUNET_FS_uri_test_loc (dc->uri)) | 2073 | if (GNUNET_FS_uri_test_loc (dc->uri)) |
2074 | GNUNET_assert (GNUNET_OK == | 2074 | GNUNET_assert (GNUNET_OK == |
@@ -2178,7 +2178,7 @@ GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h, | |||
2178 | { | 2178 | { |
2179 | dc->filename = GNUNET_strdup (filename); | 2179 | dc->filename = GNUNET_strdup (filename); |
2180 | if (GNUNET_YES == GNUNET_DISK_file_test (filename)) | 2180 | if (GNUNET_YES == GNUNET_DISK_file_test (filename)) |
2181 | GNUNET_DISK_file_size (filename, &dc->old_file_size, GNUNET_YES); | 2181 | GNUUNET_break (GNUNET_OK == GNUNET_DISK_file_size (filename, &dc->old_file_size, GNUNET_YES)); |
2182 | } | 2182 | } |
2183 | if (GNUNET_FS_uri_test_loc (dc->uri)) | 2183 | if (GNUNET_FS_uri_test_loc (dc->uri)) |
2184 | GNUNET_assert (GNUNET_OK == | 2184 | GNUNET_assert (GNUNET_OK == |