1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

s3:loadparm: refactor freeing of file_list out into free_file_lists()

Michael
This commit is contained in:
Michael Adam 2009-05-06 02:09:56 +02:00
parent a04bac7135
commit 6aef9bbbf7

View File

@ -6976,6 +6976,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.
*/
@ -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 */