summaryrefslogtreecommitdiffstats
path: root/source3/param
diff options
context:
space:
mode:
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 */