mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
added typecast for a malloc() return, and added check for NULL
This commit is contained in:
parent
8edfb370a8
commit
cbaecca8e9
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user