summaryrefslogtreecommitdiffstats
path: root/source3/param
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-05-06 02:09:56 +0200
committerMichael Adam <obnox@samba.org>2009-05-12 08:41:00 +0200
commit6aef9bbbf7160cf9e79c50e13632bf29efaedb65 (patch)
tree8e7b36fe37e086b8a4481ce6abcf993978c489f4 /source3/param
parenta04bac71356139c62d786f6254d33bd247fb7692 (diff)
downloadsamba-6aef9bbbf7160cf9e79c50e13632bf29efaedb65.tar.gz
samba-6aef9bbbf7160cf9e79c50e13632bf29efaedb65.tar.xz
samba-6aef9bbbf7160cf9e79c50e13632bf29efaedb65.zip
s3:loadparm: refactor freeing of file_list out into free_file_lists()
Michael
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index a6c535c182e..ba7c212f7f2 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -6977,6 +6977,26 @@ static void add_to_file_list(const char *fname, const char *subfname)
}
/**
+ * Free the file lists
+ */
+static void free_file_list(void)
+{
+ struct file_lists *f;
+ struct file_lists *next;
+
+ f = file_lists;
+ while( f ) {
+ next = f->next;
+ SAFE_FREE( f->name );
+ SAFE_FREE( f->subfname );
+ SAFE_FREE( f );
+ f = next;
+ }
+ file_lists = NULL;
+}
+
+
+/**
* Utility function for outsiders to check if we're running on registry.
*/
bool lp_config_backend_is_registry(void)
@@ -8962,21 +8982,9 @@ int load_usershare_shares(void)
void gfree_loadparm(void)
{
- struct file_lists *f;
- struct file_lists *next;
int i;
- /* Free the file lists */
-
- f = file_lists;
- while( f ) {
- next = f->next;
- SAFE_FREE( f->name );
- SAFE_FREE( f->subfname );
- SAFE_FREE( f );
- f = next;
- }
- file_lists = NULL;
+ free_file_list();
/* Free resources allocated to services */