Commit cbaecca8 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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

parent 8edfb370
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;
+4 −1
Original line number Diff line number Diff line
@@ -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;