Skip to content

Commit 8abc6dd

Browse files
authored
Merge pull request #743 from theShmoo/fix-malloc-without-free-#739
fix malloc without free Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>
2 parents ca3795b + f6a7fa2 commit 8abc6dd

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)