Hi.

Per Coverity.

CID 1608916: (#1 of 1): Resource leak (RESOURCE_LEAK)
52. leaked_storage: Variable buf going out of scope leaks the storage
buf.data points to.

The function *record_in* has a new report about resource leak.
I think Coverity is right.
The normal path of the function frees the memory of several variables used.
Therefore the failure path should also free them.
A quick search on the web shows several occurrences of "malformed record
literal", therefore failure is common in this function.

Although Coveriy reports the leak of only buf.data, the variables *values*
and *nulls* should also be released.

While there, move the creation of stringdata, to ensure that in case of
failure, the buf.data variable is released correctly.

Attached a path.

best regards,
Ranier Vilela

Attachment: fix-resource-leak-rowtypes.patch
Description: Binary data

Reply via email to