Skip to content

Commit f6a7fa2

Browse files
authored
fix malloc without free
Signed-off-by: David Pfahler <david@pfahler.at>
1 parent ca3795b commit f6a7fa2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sdk/simulation/uinst/u_instructions.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ void reg_sig_handler_sim()
240240
ss.ss_size = SIG_STACK_SIZE;
241241
ss.ss_sp = malloc(ss.ss_size);
242242
sigaltstack(&ss, NULL);
243-
memset(&sig_act, 0, sizeof(sig_act));
243+
static char stack[SIG_STACK_SIZE];
244+
ss.ss_sp = stack;
244245
sig_act.sa_sigaction = sig_handler_sim;
245246
// nested signals are not supported
246247
sig_act.sa_flags = SA_SIGINFO | SA_ONSTACK;

0 commit comments

Comments
 (0)