summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/file.c6
-rw-r--r--common/log.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/common/file.c b/common/file.c
index a9a06de9..b51a37cc 100644
--- a/common/file.c
+++ b/common/file.c
@@ -233,7 +233,7 @@ l_file_read_section(int fd, int max_file_size, const char *section,
int len;
int index;
int file_size;
-
+
data = (char *) g_malloc(FILE_MAX_LINE_BYTES * 3, 0);
text = data;
name = text + FILE_MAX_LINE_BYTES;
@@ -364,7 +364,7 @@ file_by_name_read_sections(const char *file_name, struct list *names)
fd = g_file_open(file_name);
- if (fd < 1)
+ if (fd < 0)
{
return 1;
}
@@ -405,7 +405,7 @@ file_by_name_read_section(const char *file_name, const char *section,
fd = g_file_open(file_name);
- if (fd < 1)
+ if (fd < 0)
{
return 1;
}
diff --git a/common/log.c b/common/log.c
index 54dfaa29..d7594d67 100644
--- a/common/log.c
+++ b/common/log.c
@@ -284,6 +284,7 @@ internalReadConfiguration(const char *inFilename, const char *applicationName)
if (ret != LOG_STARTUP_OK)
{
+ g_file_close(fd);
return ret;
}
@@ -301,6 +302,7 @@ internalReadConfiguration(const char *inFilename, const char *applicationName)
if (ret != LOG_STARTUP_OK)
{
+ g_file_close(fd);
return ret;
}