cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.03k stars 623 forks source link

Potential memory leak in the serialize method of varlen type #1368

Open chenboy opened 6 years ago

chenboy commented 6 years ago

In https://github.com/cmu-db/peloton/blob/3451aeff65a80c8a9aae8fa10f3f7083dd99ee7a/src/type/varlen_type.cpp#L181, we'll create a new char array to buffer the serialized varlen type if no memory pool is specified, I think it will not be deleted afterwards so this may cause a memory leak. I found this when working on the explain executor, which returns the plan string as a tuple.

Detail see this build:

jenkins.db.cs.cmu.edu:8080/blue/organizations/jenkins/peloton/detail/PR-1357/4/