diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2020-02-24 08:23:45 +0000 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2020-02-24 08:23:45 +0000 |
commit | a59646cbf84d1bb463c4b9526dacdf40075851c2 (patch) | |
tree | 095709d5fd677b55c829bef195948f9eba8abb9c /utils | |
parent | 3cceb8ff2b48a0ca0411109c1ad441064132fd6e (diff) | |
download | netsurf-a59646cbf84d1bb463c4b9526dacdf40075851c2.tar.gz netsurf-a59646cbf84d1bb463c4b9526dacdf40075851c2.tar.bz2 |
Hashmap: Check for failure of first malloc.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/hashmap.c | 3 |
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; |