mirror of
https://github.com/curl/curl.git
synced 2026-08-25 05:13:31 +03:00
tool: fix memory mixups
memory allocated by libcurl must be freed with curl_free() and vice versa, memory allocated by the tool itself must be freed with curlx_free(). - dynbuf: free libcurl data with curl_free() - tool_operate: make sure we get URL using the right memory - tool_operhlp: free libcurl memory with curl_free() - tool_operate: free curl_maprintf() pointer with curl_free - var: data from curlx_base64_decode needs curlx_free - tool_operate: fix memory juggling in etag handling - tool_cb_hdr: fix memory area mixups - tool_operate: another mixup in etag management - tool_cb_hdr: more memory mixup fixes - tool_cfgable.c: document some details - tool_help: show global-mem-debug in -V output Closes #21099
This commit is contained in:
parent
46d0ade086
commit
b71973c115
7 changed files with 69 additions and 28 deletions
|
|
@ -356,6 +356,9 @@ void tool_version_info(void)
|
|||
size_t feat_ext_count = feature_count;
|
||||
#ifdef CURL_CA_EMBED
|
||||
++feat_ext_count;
|
||||
#endif
|
||||
#ifdef CURL_DEBUG_GLOBAL_MEM
|
||||
++feat_ext_count;
|
||||
#endif
|
||||
feat_ext = curlx_malloc(sizeof(*feature_names) * (feat_ext_count + 1));
|
||||
if(feat_ext) {
|
||||
|
|
@ -364,6 +367,9 @@ void tool_version_info(void)
|
|||
feat_ext_count = feature_count;
|
||||
#ifdef CURL_CA_EMBED
|
||||
feat_ext[feat_ext_count++] = "CAcert";
|
||||
#endif
|
||||
#ifdef CURL_DEBUG_GLOBAL_MEM
|
||||
feat_ext[feat_ext_count++] = "global-mem-debug";
|
||||
#endif
|
||||
feat_ext[feat_ext_count] = NULL;
|
||||
qsort((void *)feat_ext, feat_ext_count, sizeof(*feat_ext),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue