From ac2780bc12c8c2fce4c5e2bfe4c4dbb58616b8e2 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 27 Oct 1997 14:25:38 +0000 Subject: [PATCH] Fixed memory leaks. --- bfile/bfile.c | 6 +++++- bfile/mfile.c | 13 ++++++++++++- isam/isam.c | 8 +++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/bfile/bfile.c b/bfile/bfile.c index ee8e707..b38ff42 100644 --- a/bfile/bfile.c +++ b/bfile/bfile.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: bfile.c,v $ - * Revision 1.24 1997-09-18 08:59:16 adam + * Revision 1.25 1997-10-27 14:25:38 adam + * Fixed memory leaks. + * + * Revision 1.24 1997/09/18 08:59:16 adam * Extra generic handle for the character mapping routines. * * Revision 1.23 1997/09/17 12:19:06 adam @@ -109,6 +112,7 @@ BFiles bfs_create (const char *spec) void bfs_destroy (BFiles bfs) { + xfree (bfs->lockDir); mf_destroy (bfs->commit_area); mf_destroy (bfs->register_area); xfree (bfs); diff --git a/bfile/mfile.c b/bfile/mfile.c index 41fc3ca..9885231 100644 --- a/bfile/mfile.c +++ b/bfile/mfile.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: mfile.c,v $ - * Revision 1.25 1997-09-18 08:59:16 adam + * Revision 1.26 1997-10-27 14:25:38 adam + * Fixed memory leaks. + * + * Revision 1.25 1997/09/18 08:59:16 adam * Extra generic handle for the character mapping routines. * * Revision 1.24 1997/09/17 12:19:06 adam @@ -336,7 +339,13 @@ void mf_destroy(MFile_area ma) meta_f = ma->mfiles; while (meta_f) { + int i; meta_file *m = meta_f; + + for (i = 0; ino_files; i++) + { + xfree (m->files[i].path); + } meta_f = meta_f->next; xfree (m); } @@ -385,6 +394,8 @@ MFile mf_open(MFile_area ma, const char *name, int block_size, int wflag) sprintf(tmp, "%s/%s.mf.%d", dp->name, mnew->name, 0); mnew->files[0].path = xstrdup(tmp); mnew->ma = ma; + mnew->next = ma->mfiles; + ma->mfiles = mnew; } else { diff --git a/isam/isam.c b/isam/isam.c index eaffdbc..362932c 100644 --- a/isam/isam.c +++ b/isam/isam.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: isam.c,v $ - * Revision 1.23 1997-09-17 12:19:20 adam + * Revision 1.24 1997-10-27 14:25:39 adam + * Fixed memory leaks. + * + * Revision 1.23 1997/09/17 12:19:20 adam * Zebra version corresponds to YAZ version 1.4. * Changed Zebra server so that it doesn't depend on global common_resource. * @@ -375,6 +378,9 @@ int is_close(ISAM is) bf_close(is->types[i].bf); } } + for (i = 0; i < is->num_types; i++) + xfree (is->types[i].dbuf); + if (is->writeflag) { logf(LOG_LOG, "ISAM statistics:"); -- 1.7.10.4