summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2020-02-24 08:23:45 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2020-02-24 08:23:45 +0000
commita59646cbf84d1bb463c4b9526dacdf40075851c2 (patch)
tree095709d5fd677b55c829bef195948f9eba8abb9c /utils
parent3cceb8ff2b48a0ca0411109c1ad441064132fd6e (diff)
downloadnetsurf-a59646cbf84d1bb463c4b9526dacdf40075851c2.tar.gz
netsurf-a59646cbf84d1bb463c4b9526dacdf40075851c2.tar.bz2
Hashmap: Check for failure of first malloc.
Diffstat (limited to 'utils')
-rw-r--r--utils/hashmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/hashmap.c b/utils/hashmap.c
index 814dc55b5..9cdc5a23a 100644
--- a/utils/hashmap.c
+++ b/utils/hashmap.c
@@ -67,6 +67,9 @@ hashmap_t *
hashmap_create(hashmap_parameters_t *params)
{
hashmap_t *ret = malloc(sizeof(hashmap_t));
+ if (ret == NULL) {
+ return NULL;
+ }
ret->params = params;
ret->bucket_count = DEFAULT_HASHMAP_BUCKETS;