Skip to content

Commit 93c6a66

Browse files
committed
Fix use after free
1 parent 177d1f8 commit 93c6a66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Primitives/emulated.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,6 @@ std::string get_backward(Module *m, uint32_t fidx) {
692692
std::stringstream transfer;
693693
auto *buffer = new char[6];
694694
sprintf(buffer, "%02" PRIx8 "00%02" PRIx8, interruptTransfer, 1);
695-
delete[] buffer;
696695

697696
// TODO: map fidx into primitive index
698697
if (fidx < ALL_PRIMITIVES) {
@@ -707,6 +706,7 @@ std::string get_backward(Module *m, uint32_t fidx) {
707706
m->sp -= primitive.t->param_count;
708707
}
709708
}
709+
delete[] buffer;
710710
return transfer.str();
711711
}
712712

0 commit comments

Comments
 (0)