Applying patch to remove undefined behavior (double free), core functionality changes, and memory leak (excluding libssh2 leaks in CCM bridge library).