From dcfe4ab475c53cec7d117fb8052b26213a4b41db Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 25 Jul 2013 01:14:48 +0530 Subject: glusterfsd, libgfapi: destroy the temporary graphs constructed for comparison * The new and the oldgraphs which have been constructed whenever there is a volfile change (either reconfigure of the existing graph or creating a new graph) for comparison should be freed. Otherwise frequent graph changes will lead to huge memory leak Change-Id: I4faddb1aa9393b34cd2de6732e537a60f600026a BUG: 948178 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/5388 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/graph.y | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libglusterfs/src/graph.y') diff --git a/libglusterfs/src/graph.y b/libglusterfs/src/graph.y index ca4301ff0ac..a220abeb9ce 100644 --- a/libglusterfs/src/graph.y +++ b/libglusterfs/src/graph.y @@ -482,6 +482,7 @@ preprocess (FILE *srcfp, FILE *dstfp) cmd_buf_size *= 2; cmd = GF_REALLOC (cmd, cmd_buf_size); if (cmd == NULL) { + GF_FREE (result); return -1; } @@ -523,6 +524,7 @@ preprocess (FILE *srcfp, FILE *dstfp) out: fseek (srcfp, 0L, SEEK_SET); fseek (dstfp, 0L, SEEK_SET); + GF_FREE (cmd); GF_FREE (result); -- cgit