[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/io/trove/trove-dbpf: dbpf-attr-cache.c

CVS commit program cvs at parl.clemson.edu
Wed Nov 11 10:01:24 EST 2009


Update of /projects/cvsroot/pvfs2-1/src/io/trove/trove-dbpf
In directory parlweb1:/tmp/cvs-serv16394/src/io/trove/trove-dbpf

Modified Files:
	dbpf-attr-cache.c 
Log Message:
patch from Michael Moore to clean up minor memory leaks on server shutdown


Index: dbpf-attr-cache.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/trove/trove-dbpf/dbpf-attr-cache.c,v
diff -p -u -r1.24 -r1.25
--- dbpf-attr-cache.c	11 Nov 2008 19:25:57 -0000	1.24
+++ dbpf-attr-cache.c	11 Nov 2009 15:01:24 -0000	1.25
@@ -140,7 +140,7 @@ int dbpf_attr_cache_initialize(
 
 int dbpf_attr_cache_finalize(void)
 {
-    int ret = -1, i = 0;
+    int ret = -1, i = 0, j = 0;
     struct qlist_head *hash_link = NULL;
     dbpf_attr_cache_elem_t *cache_elem = NULL;
 
@@ -156,6 +156,13 @@ int dbpf_attr_cache_finalize(void)
                 {
                     cache_elem = qhash_entry(
                         hash_link, dbpf_attr_cache_elem_t, hash_link);
+                    for( j = 0; j < cache_elem->num_keyval_pairs; j++ )
+                    {
+                        /* any elements still existing need their keyval pairs
+                         * data pointer free'd before the element is free'd */
+                        if( cache_elem->keyval_pairs[j].data )
+                            free(cache_elem->keyval_pairs[j].data);
+                    }
                     free(cache_elem);
                     s_current_num_cache_elems--;
                 }



More information about the Pvfs2-cvs mailing list