aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/hash.c5
-rw-r--r--lib/llist.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/hash.c b/lib/hash.c
index 1ed3cc21a..15f2029c8 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -101,7 +101,10 @@ curl_hash_alloc(int slots, curl_hash_dtor dtor)
{
curl_hash *h;
- h = malloc(sizeof(curl_hash));
+ h = (curl_hash *)malloc(sizeof(curl_hash));
+ if(NULL = h)
+ return NULL;
+
curl_hash_init(h, slots, dtor);
return h;
diff --git a/lib/llist.c b/lib/llist.c
index b031cf6ac..9103ff254 100644
--- a/lib/llist.c
+++ b/lib/llist.c
@@ -46,7 +46,10 @@ curl_llist_alloc(curl_llist_dtor dtor)
{
curl_llist *list;
- list = malloc(sizeof(curl_llist));
+ list = (curl_llist *)malloc(sizeof(curl_llist));
+ if(NULL == list)
+ return NULL;
+
curl_llist_init(list, dtor);
return list;