]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libssh: avoid plain free() of libssh-memory
authorDaniel Stenberg <daniel@haxx.se>
Mon, 18 Jan 2021 15:40:39 +0000 (16:40 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 Jan 2021 21:50:56 +0000 (22:50 +0100)
Since curl's own memory debugging system redefines free() calls to track
and fiddle with memory, it cannot be used on memory allocated by 3rd
party libraries.

Third party libraries SHOULD NOT require free() to release allocated
resources for this reason - and libs can use separate healp allocators
on some systems (like Windows) so free() doesn't necessarily work
anyway.

Filed as an issue with libssh: https://bugs.libssh.org/T268

Closes #6481

lib/vssh/libssh.c

index 70e0ded5e0c6ae9f0bc9985faf8c07c56bb468d2..3b630bcfabfb8d275db8c6409c34a1926b446819 100644 (file)
@@ -532,10 +532,10 @@ static int myssh_is_known(struct connectdata *conn)
 
 cleanup:
   if(found_base64) {
-    free(found_base64);
+    (free)(found_base64);
   }
   if(known_base64) {
-    free(known_base64);
+    (free)(known_base64);
   }
   if(hash)
     ssh_clean_pubkey_hash(&hash);