@@ -125,17 +125,20 @@ create_genesis( config_t const * config,
125
125
uchar const * identity_pubkey_ = fd_keyload_load ( config -> paths .identity_key , 1 );
126
126
if ( FD_UNLIKELY ( !identity_pubkey_ ) ) FD_LOG_ERR (( "Failed to load identity key" ));
127
127
memcpy ( options -> identity_pubkey .key , identity_pubkey_ , 32 );
128
+ fd_keyload_unload ( identity_pubkey_ , 1 );
128
129
129
130
char file_path [ PATH_MAX ];
130
131
FD_TEST ( fd_cstr_printf_check ( file_path , PATH_MAX , NULL , "%s/faucet.json" , config -> paths .base ) );
131
132
uchar const * faucet_pubkey_ = fd_keyload_load ( file_path , 1 );
132
133
if ( FD_UNLIKELY ( !faucet_pubkey_ ) ) FD_LOG_ERR (( "Failed to load faucet key" ));
133
134
memcpy ( options -> faucet_pubkey .key , faucet_pubkey_ , 32 );
135
+ fd_keyload_unload ( faucet_pubkey_ , 1 );
134
136
135
137
FD_TEST ( fd_cstr_printf_check ( file_path , PATH_MAX , NULL , "%s/stake-account.json" , config -> paths .base ) );
136
138
uchar const * stake_pubkey_ = fd_keyload_load ( file_path , 1 );
137
139
if ( FD_UNLIKELY ( !stake_pubkey_ ) ) FD_LOG_ERR (( "Failed to load stake account key" ));
138
140
memcpy ( options -> stake_pubkey .key , stake_pubkey_ , 32 );
141
+ fd_keyload_unload ( stake_pubkey_ , 1 );
139
142
140
143
if ( !strcmp ( config -> paths .vote_account , "" ) ) {
141
144
FD_TEST ( fd_cstr_printf_check ( file_path , PATH_MAX , NULL , "%s/vote-account.json" , config -> paths .base ) );
@@ -146,7 +149,7 @@ create_genesis( config_t const * config,
146
149
uchar const * vote_pubkey_ = fd_keyload_load ( file_path , 1 );
147
150
if ( FD_UNLIKELY ( !vote_pubkey_ ) ) FD_LOG_ERR (( "Failed to load vote account key" ));
148
151
memcpy ( options -> vote_pubkey .key , vote_pubkey_ , 32 );
149
-
152
+ fd_keyload_unload ( vote_pubkey_ , 1 );
150
153
151
154
options -> creation_time = (ulong )fd_log_wallclock () / (ulong )1e9 ;
152
155
options -> faucet_balance = 500000000000000000UL ;
@@ -209,11 +212,6 @@ create_genesis( config_t const * config,
209
212
210
213
fd_scratch_detach ( NULL );
211
214
212
- fd_keyload_unload ( identity_pubkey_ , 1 );
213
- fd_keyload_unload ( faucet_pubkey_ , 1 );
214
- fd_keyload_unload ( stake_pubkey_ , 1 );
215
- fd_keyload_unload ( vote_pubkey_ , 1 );
216
-
217
215
return blob_sz ;
218
216
}
219
217
0 commit comments