summaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_api.c10
-rw-r--r--src/fs/fs_directory.c2
-rw-r--r--src/fs/fs_dirmetascan.c2
-rw-r--r--src/fs/fs_download.c2
-rw-r--r--src/fs/fs_file_information.c4
-rw-r--r--src/fs/fs_getopt.c2
-rw-r--r--src/fs/fs_list_indexed.c2
-rw-r--r--src/fs/fs_test_lib.c4
-rw-r--r--src/fs/fs_tree.c4
-rw-r--r--src/fs/fs_unindex.c2
-rw-r--r--src/fs/gnunet-auto-share.c4
-rw-r--r--src/fs/gnunet-helper-fs-publish.c2
-rw-r--r--src/fs/gnunet-service-fs_pr.c4
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p.c2
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p_respect.c2
-rw-r--r--src/fs/test_gnunet_service_fs_migration.c2
16 files changed, 25 insertions, 25 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index 72d5eab15..3b8d125ad 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -371,7 +371,7 @@ GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf,
{
struct TopLevelActivity *ret;
- ret = GNUNET_malloc (sizeof (struct TopLevelActivity));
+ ret = GNUNET_new (struct TopLevelActivity);
ret->ssf = ssf;
ret->ssf_cls = ssf_cls;
GNUNET_CONTAINER_DLL_insert (h->top_head, h->top_tail, ret);
@@ -852,7 +852,7 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h, const char *fn,
GNUNET_break (0);
return NULL;
}
- ret = GNUNET_malloc (sizeof (struct GNUNET_FS_FileInformation));
+ ret = GNUNET_new (struct GNUNET_FS_FileInformation);
ret->h = h;
ksks = NULL;
chks = NULL;
@@ -1769,7 +1769,7 @@ read_download_request (struct GNUNET_BIO_ReadHandle *rh)
struct DownloadRequest *dr;
unsigned int i;
- dr = GNUNET_malloc (sizeof (struct DownloadRequest));
+ dr = GNUNET_new (struct DownloadRequest);
if ((GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->state)) ||
(GNUNET_OK != GNUNET_BIO_read_int64 (rh, &dr->offset)) ||
(GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->num_children)) ||
@@ -2127,7 +2127,7 @@ deserialize_unindex_file (void *cls, const char *filename)
char *uris;
uint32_t state;
- uc = GNUNET_malloc (sizeof (struct GNUNET_FS_UnindexContext));
+ uc = GNUNET_new (struct GNUNET_FS_UnindexContext);
uc->h = h;
uc->serialization = get_serialization_short_name (filename);
rh = GNUNET_BIO_read_open (filename);
@@ -2994,7 +2994,7 @@ GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
enum GNUNET_FS_OPTIONS opt;
va_list ap;
- ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Handle));
+ ret = GNUNET_new (struct GNUNET_FS_Handle);
ret->cfg = cfg;
ret->client_name = GNUNET_strdup (client_name);
ret->upcb = upcb;
diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c
index b26ec12d3..3f7cc45c1 100644
--- a/src/fs/fs_directory.c
+++ b/src/fs/fs_directory.c
@@ -346,7 +346,7 @@ GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData
{
struct GNUNET_FS_DirectoryBuilder *ret;
- ret = GNUNET_malloc (sizeof (struct GNUNET_FS_DirectoryBuilder));
+ ret = GNUNET_new (struct GNUNET_FS_DirectoryBuilder);
if (mdir != NULL)
ret->meta = GNUNET_CONTAINER_meta_data_duplicate (mdir);
else
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c
index 3b3615f65..83e436b16 100644
--- a/src/fs/fs_dirmetascan.c
+++ b/src/fs/fs_dirmetascan.c
@@ -463,7 +463,7 @@ GNUNET_FS_directory_scan_start (const char *filename,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting to scan directory `%s'\n",
filename_expanded);
- ds = GNUNET_malloc (sizeof (struct GNUNET_FS_DirScanner));
+ ds = GNUNET_new (struct GNUNET_FS_DirScanner);
ds->progress_callback = cb;
ds->progress_callback_cls = cb_cls;
ds->filename_expanded = filename_expanded;
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index f9f5c0a06..5d4c6d899 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -1550,7 +1550,7 @@ create_download_request (struct DownloadRequest *parent,
unsigned int head_skip;
uint64_t child_block_size;
- dr = GNUNET_malloc (sizeof (struct DownloadRequest));
+ dr = GNUNET_new (struct DownloadRequest);
dr->parent = parent;
dr->depth = depth;
dr->offset = dr_offset;
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c
index 87d618b07..d369598ef 100644
--- a/src/fs/fs_file_information.c
+++ b/src/fs/fs_file_information.c
@@ -241,7 +241,7 @@ GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h,
GNUNET_break (0);
return NULL;
}
- ret = GNUNET_malloc (sizeof (struct GNUNET_FS_FileInformation));
+ ret = GNUNET_new (struct GNUNET_FS_FileInformation);
ret->h = h;
ret->client_info = client_info;
ret->meta = GNUNET_CONTAINER_meta_data_duplicate (meta);
@@ -297,7 +297,7 @@ GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h,
{
struct GNUNET_FS_FileInformation *ret;
- ret = GNUNET_malloc (sizeof (struct GNUNET_FS_FileInformation));
+ ret = GNUNET_new (struct GNUNET_FS_FileInformation);
ret->h = h;
ret->client_info = client_info;
ret->meta = GNUNET_CONTAINER_meta_data_duplicate (meta);
diff --git a/src/fs/fs_getopt.c b/src/fs/fs_getopt.c
index d7ff97c6b..5e9510956 100644
--- a/src/fs/fs_getopt.c
+++ b/src/fs/fs_getopt.c
@@ -53,7 +53,7 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext
if (u == NULL)
{
- u = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
+ u = GNUNET_new (struct GNUNET_FS_Uri);
*uri = u;
u->type = GNUNET_FS_URI_KSK;
u->data.ksk.keywordCount = 0;
diff --git a/src/fs/fs_list_indexed.c b/src/fs/fs_list_indexed.c
index ef03dee76..7a891155e 100644
--- a/src/fs/fs_list_indexed.c
+++ b/src/fs/fs_list_indexed.c
@@ -151,7 +151,7 @@ GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h,
_("Failed to not connect to `%s' service.\n"), "fs");
return NULL;
}
- gic = GNUNET_malloc (sizeof (struct GNUNET_FS_GetIndexedContext));
+ gic = GNUNET_new (struct GNUNET_FS_GetIndexedContext);
gic->h = h;
gic->client = client;
gic->iterator = iterator;
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index 085ea3764..1e098bd60 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -452,7 +452,7 @@ GNUNET_FS_TEST_publish (struct GNUNET_TESTBED_Peer *peer,
{
struct TestPublishOperation *po;
- po = GNUNET_malloc (sizeof (struct TestPublishOperation));
+ po = GNUNET_new (struct TestPublishOperation);
po->publish_cont = cont;
po->publish_cont_cls = cont_cls;
po->publish_seed = seed;
@@ -631,7 +631,7 @@ GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer,
{
struct TestDownloadOperation *dop;
- dop = GNUNET_malloc (sizeof (struct TestDownloadOperation));
+ dop = GNUNET_new (struct TestDownloadOperation);
dop->uri = GNUNET_FS_uri_dup (uri);
dop->size = GNUNET_FS_uri_chk_get_file_size (uri);
dop->verbose = verbose;
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c
index 4e0ef8c5b..5dc39e4e6 100644
--- a/src/fs/fs_tree.c
+++ b/src/fs/fs_tree.c
@@ -276,7 +276,7 @@ GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size,
{
struct GNUNET_FS_TreeEncoder *te;
- te = GNUNET_malloc (sizeof (struct GNUNET_FS_TreeEncoder));
+ te = GNUNET_new (struct GNUNET_FS_TreeEncoder);
te->h = h;
te->size = size;
te->cls = cls;
@@ -347,7 +347,7 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te)
off = CHK_PER_INODE * (te->chk_tree_depth - 1);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TE done, reading CHK `%s' from %u\n",
GNUNET_h2s (&te->chk_tree[off].query), off);
- te->uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
+ te->uri = GNUNET_new (struct GNUNET_FS_Uri);
te->uri->type = GNUNET_FS_URI_CHK;
te->uri->data.chk.chk = te->chk_tree[off];
te->uri->data.chk.file_length = GNUNET_htonll (te->size);
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index 14ab0fd69..b446bab1b 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -767,7 +767,7 @@ GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h,
if (GNUNET_OK != GNUNET_DISK_file_size (filename, &size, GNUNET_YES, GNUNET_YES))
return NULL;
- ret = GNUNET_malloc (sizeof (struct GNUNET_FS_UnindexContext));
+ ret = GNUNET_new (struct GNUNET_FS_UnindexContext);
ret->h = h;
ret->filename = GNUNET_strdup (filename);
ret->start_time = GNUNET_TIME_absolute_get ();
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index b001cb58c..2106d67f1 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -208,7 +208,7 @@ load_state ()
(GNUNET_OK !=
GNUNET_BIO_read (rh, "id", &id, sizeof (struct GNUNET_HashCode))) )
goto error;
- wi = GNUNET_malloc (sizeof (struct WorkItem));
+ wi = GNUNET_new (struct WorkItem);
wi->id = id;
wi->filename = fn;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -605,7 +605,7 @@ add_file (void *cls,
}
else
{
- wi = GNUNET_malloc (sizeof (struct WorkItem));
+ wi = GNUNET_new (struct WorkItem);
wi->filename = GNUNET_strdup (filename);
}
wi->id = id;
diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c
index 214650b0f..c64dece42 100644
--- a/src/fs/gnunet-helper-fs-publish.c
+++ b/src/fs/gnunet-helper-fs-publish.c
@@ -328,7 +328,7 @@ preprocess_file (const char *filename,
: GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_FILE,
filename, strlen (filename) + 1))
return GNUNET_SYSERR;
- item = GNUNET_malloc (sizeof (struct ScanTreeNode));
+ item = GNUNET_new (struct ScanTreeNode);
item->filename = GNUNET_strdup (filename);
item->is_directory = (S_ISDIR (sbuf.st_mode)) ? GNUNET_YES : GNUNET_NO;
item->file_size = fsize;
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index e3ce8dd69..0af19d537 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -1078,7 +1078,7 @@ handle_dht_reply (void *cls, struct GNUNET_TIME_Absolute exp,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Replicating result for query `%s' with priority %u\n",
GNUNET_h2s (key), prq.priority);
- pmc = GNUNET_malloc (sizeof (struct PutMigrationContext));
+ pmc = GNUNET_new (struct PutMigrationContext);
pmc->start = GNUNET_TIME_absolute_get ();
pmc->requested = GNUNET_YES;
if (NULL ==
@@ -1675,7 +1675,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Replicating result for query `%s' with priority %u\n",
GNUNET_h2s (&query), prq.priority);
- pmc = GNUNET_malloc (sizeof (struct PutMigrationContext));
+ pmc = GNUNET_new (struct PutMigrationContext);
pmc->start = GNUNET_TIME_absolute_get ();
pmc->requested = prq.request_found;
GNUNET_assert (0 != GSF_get_peer_performance_data_ (cp)->pid);
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c
index 2462bb3f2..17a27f803 100644
--- a/src/fs/perf_gnunet_service_fs_p2p.c
+++ b/src/fs/perf_gnunet_service_fs_p2p.c
@@ -263,7 +263,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_free (fancy);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n",
(unsigned long long) FILESIZE);
- sm = GNUNET_malloc (sizeof (struct StatMaster));
+ sm = GNUNET_new (struct StatMaster);
sm->op =
GNUNET_TESTBED_service_connect (NULL,
daemons[sm->daemon],
diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c
index b2471a8b4..4d6de9a90 100644
--- a/src/fs/perf_gnunet_service_fs_p2p_respect.c
+++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c
@@ -308,7 +308,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
return; /* more downloads to come */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Finished all downloads, getting statistics\n");
- sm = GNUNET_malloc (sizeof (struct StatMaster));
+ sm = GNUNET_new (struct StatMaster);
sm->op =
GNUNET_TESTBED_service_connect (NULL,
daemons[sm->daemon],
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c
index 770c212ba..4defe119b 100644
--- a/src/fs/test_gnunet_service_fs_migration.c
+++ b/src/fs/test_gnunet_service_fs_migration.c
@@ -151,7 +151,7 @@ do_wait (void *cls, const struct GNUNET_FS_Uri *uri,
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Waiting to allow content to migrate\n");
- dc = GNUNET_malloc (sizeof (struct DownloadContext));
+ dc = GNUNET_new (struct DownloadContext);
dc->uri = GNUNET_FS_uri_dup (uri);
if (NULL != fn)
dc->fn = GNUNET_strdup (fn);