You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Memory Leak in pgmoneta_management_create_header function #460
So I tried to debug this and seems like in pgmoneta_management_create_header() we are allocation the struct json object j and freeing as well in error section by calling pgmoneta_json_destroy() where we are also checking if object is NULL. Hence, the flow looks good and the issue seems to be strange to me.
However, I tried to add explicit checks for NULL before calling pgmoneta_json_destroy() for both j and header in the error part and it seems to be resolving the issue.
However I am not sure, if this is the correct way, I am really keen interested to work on this issue, let me know what need to be done.
Activity
Annupamaa commentedon Jan 17, 2025
So I tried to debug this and seems like in pgmoneta_management_create_header() we are allocation the struct json object j and freeing as well in error section by calling pgmoneta_json_destroy() where we are also checking if object is NULL. Hence, the flow looks good and the issue seems to be strange to me.
However, I tried to add explicit checks for NULL before calling pgmoneta_json_destroy() for both j and header in the error part and it seems to be resolving the issue.
However I am not sure, if this is the correct way, I am really keen interested to work on this issue, let me know what need to be done.
jesperpedersen commentedon Jan 17, 2025
@shikharish Can you take a look ?
[pgmoneta#460] Proper error checking in master_key()
shikharish commentedon Jan 18, 2025
@Annupamaa There was no cleanup in case of error in master_key(). I missed it in my last PR, thanks for reporting this. I have fixed it for now.