From cbaecca8e948cda6c603a715ac1e984784d77855 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 18 Jan 2002 10:30:51 +0000 Subject: added typecast for a malloc() return, and added check for NULL --- lib/hash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/hash.c') 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; -- cgit v1.2.1