Memory leak when parsing MultiBulk response
TheoTusch opened this issue · 4 comments
Hi there,
I'm new to this site and don't know if there is a better way of doing this, but I would like to report an issue I had when using qredisclient:
I think there is a memory leak when parsing MultiBulk responses in RedisClient::Response::parse()
:
A new object is created in reply = convertUnsafeArray(reply);
. By doing that, we lose track of the object that reply
pointed to before and it never gets deleted properly.
Actually, not only is the object that reply
pointed to (a QVariant
containing QVector<QVariant*>
) lost, but also the QVariants that it in turn pointed to.
There should be a deep delete of the original reply.
Please have a look and see if you agree.
Best Regards
Theo
Hello @TheoTusch
Please review my fix here https://github.com/uglide/qredisclient/pull/8/files
Thanks!