You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by "jrgemignani (via GitHub)" <gi...@apache.org> on 2023/08/09 17:52:43 UTC
[GitHub] [age] jrgemignani commented on a diff in pull request #1029: Fix memory leak issues with age_load
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: commits-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org