Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 5babb4f

Browse files
Tan, Yew Waynephmccarty
authored andcommitted
Free configured urls on server exit
1 parent aa87b16 commit 5babb4f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/server.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ int configure_urls(void)
133133
return count;
134134
}
135135

136+
void free_urls(void)
137+
{
138+
if (urls != urls_default) {
139+
for (int i=0; i<urls_size; i++) {
140+
free(urls[i]);
141+
}
142+
free(urls);
143+
}
144+
}
145+
136146
#ifdef HAVE_ATOMIC_SUPPORT
137147

138148
static atomic_int current_connection_count = 0;
@@ -596,6 +606,8 @@ int main(__nc_unused__ int argc, __nc_unused__ char **argv)
596606
if (hash) {
597607
nc_hashmap_free(hash);
598608
}
609+
610+
free_urls();
599611
}
600612

601613
/*

0 commit comments

Comments
 (0)