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:
parent
a04bac7135
commit
6aef9bbbf7
@ -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.
|
* 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)
|
void gfree_loadparm(void)
|
||||||
{
|
{
|
||||||
struct file_lists *f;
|
|
||||||
struct file_lists *next;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Free the file lists */
|
free_file_list();
|
||||||
|
|
||||||
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 resources allocated to services */
|
/* Free resources allocated to services */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user