diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-01-18 10:30:51 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-01-18 10:30:51 +0000 |
commit | cbaecca8e948cda6c603a715ac1e984784d77855 (patch) | |
tree | 8c943809ee67f9d555d22429a48fddaecaa4b886 /lib/llist.c | |
parent | 8edfb370a86dc97a09a689a1bddcfda76c608137 (diff) | |
download | curl-cbaecca8e948cda6c603a715ac1e984784d77855.tar.gz |
added typecast for a malloc() return, and added check for NULL
Diffstat (limited to 'lib/llist.c')
-rw-r--r-- | lib/llist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/llist.c b/lib/llist.c index b031cf6ac..9103ff254 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -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; |