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:
1f798af
)
if a malloc fails, clear up the memory and return failure
author
Daniel Stenberg
<daniel@haxx.se>
Mon, 10 May 2004 14:04:06 +0000
(14:04 +0000)
committer
Daniel Stenberg
<daniel@haxx.se>
Mon, 10 May 2004 14:04:06 +0000
(14:04 +0000)
lib/cookie.c
patch
|
blob
|
history
diff --git
a/lib/cookie.c
b/lib/cookie.c
index
097a7d0
..
41f1401
100644
(file)
--- a/
lib/cookie.c
+++ b/
lib/cookie.c
@@
-705,6
+705,16
@@
struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
/* point the main to us */
mainco = newco;
}
+ else {
+ /* failure, clear up the allocated chain and return NULL */
+ while(mainco) {
+ co = mainco->next;
+ free(mainco);
+ mainco = co;
+ }
+
+ return NULL;
+ }
}
}
}