SIGN IN SIGN UP

Fix(network): guard cleanup against NULL g_last_added_network

Every error path in handle_network_info() called
network_info_cleanup(g_last_added_network) unconditionally.
network_info_cleanup(NULL) erases the entire dynamic network list, so a
single malformed PROVIDE_NETWORK_INFO APDU sent before any network was
registered wiped all previously loaded networks and freed any icons held
by live reviews.

Add a NULL check before each cleanup call on error paths.

(cherry picked from commit a66734d5a7e78d347c2b2078eced02eaf5e98011)
C
Charles-Edouard de la Vergne committed
4dcfcc684ac55c8b8faa371e5e1c3ea3af989329
Parent: 48c8331
Committed by Alexandre Paillier <alexandre.paillier@ledger.fr> on 8/25/2026, 3:25:42 PM