From: Daniel Stenberg Date: Sun, 19 Oct 2008 20:37:24 +0000 (+0000) Subject: dumpeasycode() uses warnf() which uses config->errors so we must not close X-Git-Tag: curl-7_19_1~103 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3f1b9f095af2aafa37cd545f74d9f451d227e7c4;p=thirdparty%2Fcurl.git dumpeasycode() uses warnf() which uses config->errors so we must not close that before dumpeasycode() is called. Found by coverity.com --- diff --git a/src/main.c b/src/main.c index e266351a29..8212c028f6 100644 --- a/src/main.c +++ b/src/main.c @@ -5064,13 +5064,16 @@ quit_curl: if(config->trace_fopened && config->trace_stream) fclose(config->trace_stream); + /* Dump the libcurl code if previously enabled. + NOTE: that this function relies on config->errors amongst other things + so not everything can be closed and cleaned before this is called */ + dumpeasycode(config); + if(config->errors_fopened) fclose(config->errors); main_free(); /* cleanup */ - dumpeasycode(config); - return res; }