aboutsummaryrefslogtreecommitdiff
path: root/src/relooper
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-01-13 12:43:55 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-01-13 12:43:55 -0800
commitb97c1bc76ca7fa519ecb294e96c763e2e089653c (patch)
tree600a190766442b4139fde02ce60930d42aceabb1 /src/relooper
parentd1f37af9792b048f7ef98140d067ba129a97c565 (diff)
avoid leaks on multiple calls to relooper MakeOutputBuffer
Diffstat (limited to 'src/relooper')
-rw-r--r--src/relooper/Relooper.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/relooper/Relooper.cpp b/src/relooper/Relooper.cpp
index 1bad872f..d5772c62 100644
--- a/src/relooper/Relooper.cpp
+++ b/src/relooper/Relooper.cpp
@@ -1191,6 +1191,7 @@ void Relooper::SetOutputBuffer(char *Buffer, int Size) {
}
void Relooper::MakeOutputBuffer(int Size) {
+ if (OutputBufferRoot && OutputBufferSize >= Size && OutputBufferOwned) return;
OutputBufferRoot = OutputBuffer = (char*)malloc(Size);
OutputBufferSize = Size;
OutputBufferOwned = true;