Skip to content

Commit 85411cf

Browse files
authored
Update tnt_main.c
1 parent 1c4935b commit 85411cf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tnt_main.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,11 @@ static SecMap* copy_for_writing ( SecMap* dist_sm )
180180
|| dist_sm == &sm_distinguished[1]
181181
|| dist_sm == &sm_distinguished[2]);
182182

183-
new_sm = VG_(am_shadow_alloc)(sizeof(SecMap));
184-
if (new_sm == NULL)
185-
VG_(out_of_memory_NORETURN)( "memcheck:allocate new SecMap",
186-
sizeof(SecMap) );
183+
SysRes sres = VG_(am_shadow_alloc)(sizeof(SecMap));
184+
if (sr_isError(sres))
185+
VG_(out_of_memory_NORETURN)( "tnt_main:allocate new SecMap",
186+
sizeof(SecMap), sr_Err(sres) );
187+
new_sm = (void *)(Addr)sr_Res(sres);
187188
VG_(memcpy)(new_sm, dist_sm, sizeof(SecMap));
188189
update_SM_counts(dist_sm, new_sm);
189190
return new_sm;

0 commit comments

Comments
 (0)