mirror of https://github.com/moparisthebest/curl
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;
|
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);
|
curl_hash_init(h, slots, dtor);
|
||||||
|
|
||||||
return h;
|
return h;
|
||||||
|
|
|
@ -46,7 +46,10 @@ curl_llist_alloc(curl_llist_dtor dtor)
|
||||||
{
|
{
|
||||||
curl_llist *list;
|
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);
|
curl_llist_init(list, dtor);
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
|
Loading…
Reference in New Issue