gfphoenix78 commented on code in PR #1424:
URL: https://github.com/apache/cloudberry/pull/1424#discussion_r2509126025


##########
src/backend/crypto/bufenc.c:
##########
@@ -51,12 +51,9 @@ InitializeBufferEncryption(void)
 
        if (CheckIsSM4Method())
        {
-               bool found;
-               BufEncCtx = ShmemInitStruct("sm4 encryption method encrypt ctx",
-                                                                               
                sizeof(sm4_ctx), &found);
+               BufEncCtx = malloc(sizeof(sm4_ctx));

Review Comment:
   Why not use a static memory block? This function will be called in 
postmaster process. When the postmaster resets the cluster, it will allocate an 
additional memory buffer, so memory leaks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to