fix: double free

master
Sean McBride 3 years ago
parent 1457f6f2a8
commit c9fc627375

@ -17,12 +17,11 @@ struct module_config {
}; };
static inline void static inline void
module_config_free(struct module_config *config) module_config_deinit(struct module_config *config)
{ {
free(config->name); free(config->name);
free(config->path); free(config->path);
free(config->http_resp_content_type); free(config->http_resp_content_type);
free(config);
} }
static inline void static inline void

@ -481,8 +481,9 @@ main(int argc, char **argv)
} }
for (int module_idx = 0; module_idx < module_config_vec_len; module_idx++) { for (int module_idx = 0; module_idx < module_config_vec_len; module_idx++) {
module_config_free(&module_config_vec[module_idx]); module_config_deinit(&module_config_vec[module_idx]);
} }
free(module_config_vec);
for (int i = 0; i < runtime_worker_threads_count; i++) { for (int i = 0; i < runtime_worker_threads_count; i++) {
int ret = pthread_join(runtime_worker_threads[i], NULL); int ret = pthread_join(runtime_worker_threads[i], NULL);

Loading…
Cancel
Save