You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by jg...@apache.org on 2022/03/22 21:47:36 UTC

[incubator-age] branch master updated: Fix small memory leak in VLE

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 2462000  Fix small memory leak in VLE
2462000 is described below

commit 2462000700eeb0249b2d2a4e9c8465aea9883fbb
Author: John Gemignani <jr...@gmail.com>
AuthorDate: Tue Mar 22 12:53:36 2022 -0700

    Fix small memory leak in VLE
    
    Fixed a small memory leak in the VLE. A character string for the edge
    lable name in the local VLE context was not getting freed.
---
 src/backend/utils/adt/age_vle.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/backend/utils/adt/age_vle.c b/src/backend/utils/adt/age_vle.c
index a676d09..4ec40f9 100644
--- a/src/backend/utils/adt/age_vle.c
+++ b/src/backend/utils/adt/age_vle.c
@@ -358,8 +358,18 @@ static void free_VLE_local_context(VLE_local_context *vlelctx)
     }
 
     /* free the stored graph name */
-    pfree(vlelctx->graph_name);
-    vlelctx->graph_name = NULL;
+    if (vlelctx->graph_name != NULL)
+    {
+        pfree(vlelctx->graph_name);
+        vlelctx->graph_name = NULL;
+    }
+
+    /* free the stored edge label name */
+    if (vlelctx->edge_label_name != NULL)
+    {
+        pfree(vlelctx->edge_label_name);
+        vlelctx->edge_label_name = NULL;
+    }
 
     /* we need to free our state hashtable */
     hash_destroy(vlelctx->edge_state_hashtable);