added typecast for a malloc() return, and added check for NULL

This commit is contained in:
Daniel Stenberg
2002-01-18 10:30:51 +00:00
parent 8edfb370a8
commit cbaecca8e9
2 changed files with 8 additions and 2 deletions

View File

@@ -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;