log: remove unused code and fix potential memory leak

master
daixj 7 years ago committed by metalefty
parent 09712d70ad
commit 551bb185c5

@ -270,7 +270,6 @@ internalReadConfiguration(const char *inFilename, const char *applicationName)
{ {
int fd; int fd;
enum logReturns ret = LOG_GENERAL_ERROR; enum logReturns ret = LOG_GENERAL_ERROR;
struct list *sec;
struct list *param_n; struct list *param_n;
struct list *param_v; struct list *param_v;
@ -299,9 +298,6 @@ internalReadConfiguration(const char *inFilename, const char *applicationName)
return ret; return ret;
} }
sec = list_create();
sec->auto_free = 1;
file_read_sections(fd, sec);
param_n = list_create(); param_n = list_create();
param_n->auto_free = 1; param_n->auto_free = 1;
param_v = list_create(); param_v = list_create();
@ -311,14 +307,7 @@ internalReadConfiguration(const char *inFilename, const char *applicationName)
ret = internal_config_read_logging(fd, g_staticLogConfig, param_n, ret = internal_config_read_logging(fd, g_staticLogConfig, param_n,
param_v, applicationName); param_v, applicationName);
if (ret != LOG_STARTUP_OK)
{
g_file_close(fd);
return ret;
}
/* cleanup */ /* cleanup */
list_delete(sec);
list_delete(param_v); list_delete(param_v);
list_delete(param_n); list_delete(param_n);
g_file_close(fd); g_file_close(fd);

Loading…
Cancel
Save