jrgemignani commented on code in PR #1029:
URL: https://github.com/apache/age/pull/1029#discussion_r1261822648


##########
src/backend/utils/adt/agtype_util.c:
##########
@@ -2304,3 +2304,81 @@ char *agtype_value_type_to_string(enum agtype_value_type 
type)
 
     return NULL;
 }
+
+/*
+ * Deallocates the passed agtype_value recursively.
+ */
+void pfree_agtype_value(agtype_value* value)
+{
+    pfree_agtype_value_content(value);
+    pfree(value);
+}
+
+/*
+ * Helper function that recursively deallocates the contents 
+ * of the passed agtype_value only. It does not deallocate
+ * `value` itself.
+ */
+void pfree_agtype_value_content(agtype_value* value)
+{
+    int i;
+

Review Comment:
   Please look into the **possibility** of using this, as you are using 
recursion, if it applies -
   
   ```
   /* Guard against stack overflow due to overly complex set-expressions */
       check_stack_depth();
   ```



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