aboutsummaryrefslogtreecommitdiff
path: root/lib/hash.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-01-18 10:30:51 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-01-18 10:30:51 +0000
commitcbaecca8e948cda6c603a715ac1e984784d77855 (patch)
tree8c943809ee67f9d555d22429a48fddaecaa4b886 /lib/hash.c
parent8edfb370a86dc97a09a689a1bddcfda76c608137 (diff)
added typecast for a malloc() return, and added check for NULL
Diffstat (limited to 'lib/hash.c')
-rw-r--r--lib/hash.c5
1 files changed, 4 insertions, 1 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;