MuhammadTahaNaveed commented on code in PR #2066:
URL: https://github.com/apache/age/pull/2066#discussion_r1729171663


##########
src/backend/utils/adt/agtype.c:
##########
@@ -3968,8 +4093,14 @@ Datum agtype_access_operator(PG_FUNCTION_ARGS)
         container = NULL;
     }
 
+    pfree(args);
+    pfree(types);
+    pfree(nulls);
+
     /* serialize and return the result */
-    return AGTYPE_P_GET_DATUM(agtype_value_to_agtype(container_value));
+    result = agtype_value_to_agtype(container_value);
+

Review Comment:
   `container_value` should be freed here?



##########
src/backend/utils/adt/agtype.c:
##########
@@ -3090,18 +3152,27 @@ Datum agtype_to_text(PG_FUNCTION_ARGS)
 
     /* Return null if arg_agt is null. This covers SQL and Agtype NULLS */
     if (arg_agt == NULL)
+    {
         PG_RETURN_NULL();
+    }
 
     /* check that we have a scalar value */
     if (!AGT_ROOT_IS_SCALAR(arg_agt))
+    {
+        PG_FREE_IF_COPY(arg_agt, 0);

Review Comment:
   We don't need this here, right?



-- 
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]

Reply via email to