projects
/
platform
/
upstream
/
curl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8edfb37
)
added typecast for a malloc() return, and added check for NULL
author
Daniel Stenberg
<daniel@haxx.se>
Fri, 18 Jan 2002 10:30:51 +0000
(10:30 +0000)
committer
Daniel Stenberg
<daniel@haxx.se>
Fri, 18 Jan 2002 10:30:51 +0000
(10:30 +0000)
lib/hash.c
patch
|
blob
|
history
lib/llist.c
patch
|
blob
|
history
diff --git
a/lib/hash.c
b/lib/hash.c
index
1ed3cc2
..
15f2029
100644
(file)
--- a/
lib/hash.c
+++ b/
lib/hash.c
@@
-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;
diff --git
a/lib/llist.c
b/lib/llist.c
index
b031cf6
..
9103ff2
100644
(file)
--- 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;