]> granicus.if.org Git - curl/commit
curl_schannel: Improvements to memory re-allocation strategy
authorMarc Hoersken <info@marc-hoersken.de>
Sun, 14 Dec 2014 16:27:20 +0000 (17:27 +0100)
committerMarc Hoersken <info@marc-hoersken.de>
Sun, 14 Dec 2014 16:27:31 +0000 (17:27 +0100)
commit212e3e26bc711c4bd2e0a1c2bbc14b4e40506917
tree6b67ffb70f080f026a3f320104613a8633ce1604
parent125f65513157622e9e50d3b6868ec069a3e3e1e8
curl_schannel: Improvements to memory re-allocation strategy

- do not grow memory by doubling its size
- do not leak previously allocated memory if reallocation fails
- replace while-loop with a single check to make sure
  that the requested amount of data fits into the buffer

Bug: http://curl.haxx.se/bug/view.cgi?id=1450
Reported-by: Warren Menzer
lib/vtls/curl_schannel.c
lib/vtls/curl_schannel.h