projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed compile warnings under windows
[oweals/gnunet.git]
/
src
/
util
/
container_bloomfilter.c
diff --git
a/src/util/container_bloomfilter.c
b/src/util/container_bloomfilter.c
index 2bdf371974f6d50636677f4a6b613dd289016fdf..6e8fc78377f4db6ec600e423222752072bc60c3d 100644
(file)
--- a/
src/util/container_bloomfilter.c
+++ b/
src/util/container_bloomfilter.c
@@
-433,6
+433,14
@@
GNUNET_CONTAINER_bloomfilter_load (const char *filename,
}
/* Alloc block */
bf->bitArray = GNUNET_malloc_large (size);
}
/* Alloc block */
bf->bitArray = GNUNET_malloc_large (size);
+ if (bf->bitArray == NULL)
+ {
+ if (bf->fh != NULL)
+ GNUNET_DISK_file_close (bf->fh);
+ GNUNET_free_non_null (bf->filename);
+ GNUNET_free (bf);
+ return NULL;
+ }
bf->bitArraySize = size;
bf->addressesPerElement = k;
memset (bf->bitArray, 0, bf->bitArraySize);
bf->bitArraySize = size;
bf->addressesPerElement = k;
memset (bf->bitArray, 0, bf->bitArraySize);
@@
-505,6
+513,11
@@
GNUNET_CONTAINER_bloomfilter_init (const char *data,
bf->filename = NULL;
bf->fh = NULL;
bf->bitArray = GNUNET_malloc_large (size);
bf->filename = NULL;
bf->fh = NULL;
bf->bitArray = GNUNET_malloc_large (size);
+ if (bf->bitArray == NULL)
+ {
+ GNUNET_free (bf);
+ return NULL;
+ }
bf->bitArraySize = size;
bf->addressesPerElement = k;
if (data != NULL)
bf->bitArraySize = size;
bf->addressesPerElement = k;
if (data != NULL)
@@
-640,7
+653,7
@@
GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf,
for (i = 0; i < n; i++)
fc[i] |= dc[i];
for (i = n * sizeof(unsigned long long); i < size; i++)
for (i = 0; i < n; i++)
fc[i] |= dc[i];
for (i = n * sizeof(unsigned long long); i < size; i++)
- bf->bitArray[i] |= data[i]
+ bf->bitArray[i] |= data[i]
;
return GNUNET_OK;
}
return GNUNET_OK;
}