This is an automated email from the ASF dual-hosted git repository.

jgemignani pushed a commit to branch PG12
in repository https://gitbox.apache.org/repos/asf/age.git

commit d91a63259b98fac979b52d63c4c9ec0a4d22c55e
Author: John Gemignani <[email protected]>
AuthorDate: Mon Oct 17 15:51:34 2022 -0700

    Fix delete_global_graphs
    
    Fixed the delete_global_graphs function. It was not keeping track of
    the previous graph global context pointer.
    
    This was causing a memory leak for multiple graph contexts if
    individual graphs were deleted.
---
 src/backend/utils/adt/age_global_graph.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/backend/utils/adt/age_global_graph.c 
b/src/backend/utils/adt/age_global_graph.c
index b980bd6..3a155e2 100644
--- a/src/backend/utils/adt/age_global_graph.c
+++ b/src/backend/utils/adt/age_global_graph.c
@@ -867,7 +867,8 @@ static bool delete_specific_GRAPH_global_contexts(char 
*graph_name)
             return true;
         }
 
-        /* advance to the next one */
+        /* save the current as previous and advance to the next one */
+        prev_ggctx = curr_ggctx;
         curr_ggctx = next_ggctx;
     }
 

Reply via email to