Skip to content

Commit 3b1ae36

Browse files
committed
test
1 parent 3442a8e commit 3b1ae36

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/discof/rpcserver/fd_rpc_service.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,6 +2294,9 @@ void
22942294
fd_rpc_create_ctx(fd_rpcserver_args_t * args, fd_rpc_ctx_t ** ctx_p) {
22952295
fd_rpc_ctx_t * ctx = (fd_rpc_ctx_t *)fd_spad_alloc( args->spad, alignof(fd_rpc_ctx_t), sizeof(fd_rpc_ctx_t) );
22962296
fd_rpc_global_ctx_t * gctx = (fd_rpc_global_ctx_t *)fd_spad_alloc( args->spad, alignof(fd_rpc_global_ctx_t), sizeof(fd_rpc_global_ctx_t) );
2297+
if ( FD_UNLIKELY ( (NULL == ctx) || (NULL == gctx) ) ) {
2298+
FD_LOG_ERR(( "fd_spad_alloc failed" ));
2299+
}
22972300
fd_memset(ctx, 0, sizeof(fd_rpc_ctx_t));
22982301
fd_memset(gctx, 0, sizeof(fd_rpc_global_ctx_t));
22992302

src/flamenco/runtime/fd_runtime.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,6 +2776,9 @@ fd_runtime_read_genesis( fd_exec_slot_ctx_t * slot_ctx,
27762776
longer spad-backed. */
27772777

27782778
uchar * buf = fd_spad_alloc( runtime_spad, alignof(ulong), (ulong)sbuf.st_size );
2779+
if( FD_UNLIKELY( NULL == buf ) ) {
2780+
FD_LOG_ERR(( "fd_spad_alloc failed" ));
2781+
}
27792782
ulong sz = 0UL;
27802783
int res = fd_io_read( fd, buf, (ulong)sbuf.st_size, (ulong)sbuf.st_size, &sz );
27812784
FD_TEST( res==0 );

src/flamenco/runtime/tests/fd_dump_pb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,9 @@ create_block_context_protobuf_from_block_tx_only( fd_exec_test_block_context_t *
580580
/* BlockContext -> txns */
581581
block_context->txns_count = 0U;
582582
block_context->txns = fd_spad_alloc( spad, alignof(fd_exec_test_sanitized_transaction_t), block_info->txn_cnt * sizeof(fd_exec_test_sanitized_transaction_t) );
583+
if( FD_UNLIKELY( NULL == block_context->txns ) ) {
584+
FD_LOG_ERR(( "fd_spad_alloc failed" ));
585+
}
583586
fd_memset( block_context->txns, 0, block_info->txn_cnt * sizeof(fd_exec_test_sanitized_transaction_t) );
584587

585588
/* BlockContext -> acct_states

0 commit comments

Comments
 (0)