Skip to content

Commit e501d46

Browse files
committed
Fix memory leak during unserialize
1 parent edadf13 commit e501d46

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

classes/ByteBufferWriter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ WRITER_METHOD(__unserialize) {
233233
}
234234

235235
auto object = WRITER_THIS();
236+
//would be nice to prevent this from being allocated, but I suppose it's also possible someone could call __unserialize() directly
237+
efree(object->writer.buffer);
236238

237239
writer_init_properties(object, reinterpret_cast<unsigned char*>(Z_STRVAL_P(buffer)), Z_STRLEN_P(buffer), Z_LVAL_P(offset));
238240
}

0 commit comments

Comments
 (0)