kolo / xmlrpc

Implementation of XMLRPC protocol in Go language.
MIT License
159 stars 94 forks source link

client: Handle NewRequest errors before adding cookies #65

Closed vinzenz closed 5 years ago

vinzenz commented 5 years ago

Previously WriteRequest attempted to add cookies to the httpRequest instance even if an error happened and might have resulted in httpRequest being nil which in turn caused a crash. This patch moves the error handling before looping through the current cookies to avoid this crash from happening.

Signed-off-by: Vinzenz Feenstra evilissimo@gmail.com

icholy commented 5 years ago

Good catch.