BBS:      TELESC.NET.BR
Assunto:  src/ssh/TODO.md ssh-trans.c
De:       Deuc¨
Data:     Sat, 28 Mar 2026 12:55:04 -0700
-----------------------------------------------------------
https://gitlab.synchro.net/main/sbbs/-/commit/9f6265e5b8324eb042024b8f
Modified Files:
	src/ssh/TODO.md ssh-trans.c
Log Message:
Close item 17: replace cascading cleanup with goto in transport_init/newkeys

transport_init: 7 allocation failure points (4 buffers + 3 sync
primitives) each duplicated cleanup of all prior resources.  Replaced
with goto init_cleanup; bool flags track which sync primitives need
destroying.

newkeys: 6 key buffer mallocs had cascading cleanse_free chains;
replaced with NULL-initialized pointers and goto keys_cleanup
(reusing the existing label).  Also simplified the post-derive_key
error block from 8 lines to a single goto.

Eliminates ~50 lines of duplicated cleanup code across 8 error paths.

Co-Authored-By: Claude Opus 4.6 (1M context) 
n
---
  mSynchronetn  hgVertrauen n hHome of Synchronet n gh[vert/cvs/bbs].synchro.net

-----------------------------------------------------------
[Voltar]