diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-13 12:43:55 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-13 12:43:55 -0800 |
commit | b97c1bc76ca7fa519ecb294e96c763e2e089653c (patch) | |
tree | 600a190766442b4139fde02ce60930d42aceabb1 | |
parent | d1f37af9792b048f7ef98140d067ba129a97c565 (diff) |
avoid leaks on multiple calls to relooper MakeOutputBuffer
-rw-r--r-- | src/relooper/Relooper.cpp | 1 |
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; |