From 17f48fe87979f159e2d8769d678641c60f4c0eed Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 7 Oct 2011 20:50:57 +0200 Subject: libcurl: some OOM handling fixes --- lib/hash.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/hash.c') diff --git a/lib/hash.c b/lib/hash.c index 3a6e312a3..15b3efff6 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -72,9 +72,12 @@ Curl_hash_init(struct curl_hash *h, for(i = 0; i < slots; ++i) { h->table[i] = Curl_llist_alloc((curl_llist_dtor) hash_element_dtor); if(!h->table[i]) { - while(i--) + while(i--) { Curl_llist_destroy(h->table[i], NULL); + h->table[i] = NULL; + } free(h->table); + h->table = NULL; return 1; /* failure */ } } @@ -240,6 +243,7 @@ Curl_hash_clean(struct curl_hash *h) } free(h->table); + h->table = NULL; } void -- cgit v1.2.3