From aa9d926aadca2a8a67ed09f9031f7652297cad44 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 15 Mar 2012 13:01:56 +0000 Subject: -check return values, fix leak --- src/fs/fs_api.c | 2 ++ src/fs/fs_download.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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) GNUNET_break (0); goto cleanup; } + uris = NULL; if ((GNUNET_OK != GNUNET_BIO_read_string (rh, "unindex-fn", &uc->filename, 10 * 1024)) || (GNUNET_OK != GNUNET_BIO_read_int64 (rh, &uc->file_size)) || @@ -1994,6 +1995,7 @@ deserialize_unindex_file (void *cls, const char *filename) (GNUNET_OK != GNUNET_BIO_read_string (rh, "unindex-kskuri", &uris, 10 * 1024)) || (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &uc->ksk_offset)) ) { + GNUNET_free_non_null (uris); GNUNET_break (0); goto cleanup; } 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, { dc->filename = GNUNET_strdup (filename); if (GNUNET_YES == GNUNET_DISK_file_test (filename)) - GNUNET_DISK_file_size (filename, &dc->old_file_size, GNUNET_YES); + GNUNET_break (GNUNET_OK == GNUNET_DISK_file_size (filename, &dc->old_file_size, GNUNET_YES)); } if (GNUNET_FS_uri_test_loc (dc->uri)) GNUNET_assert (GNUNET_OK == @@ -2178,7 +2178,7 @@ GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h, { dc->filename = GNUNET_strdup (filename); if (GNUNET_YES == GNUNET_DISK_file_test (filename)) - GNUNET_DISK_file_size (filename, &dc->old_file_size, GNUNET_YES); + GNUUNET_break (GNUNET_OK == GNUNET_DISK_file_size (filename, &dc->old_file_size, GNUNET_YES)); } if (GNUNET_FS_uri_test_loc (dc->uri)) GNUNET_assert (GNUNET_OK == -- cgit v1.2.3