summaryrefslogtreecommitdiffstats
path: root/keygen
diff options
context:
space:
mode:
authorLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2014-07-19 11:56:00 -0700
committerLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2014-07-19 11:56:00 -0700
commit3bb31876e797c7a13b4ffb7d67a5d710cbf4fab3 (patch)
tree8888abf5bfb3b666027746c78a7466e09fa3a557 /keygen
parentc64b1544752547cede30647bb03ab1bbbc06d079 (diff)
downloadxrdp-proprietary-3bb31876e797c7a13b4ffb7d67a5d710cbf4fab3.tar.gz
xrdp-proprietary-3bb31876e797c7a13b4ffb7d67a5d710cbf4fab3.zip
coverity: fixed resolution leak issues
Diffstat (limited to 'keygen')
-rw-r--r--keygen/keygen.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/keygen/keygen.c b/keygen/keygen.c
index bd47f73a..0cd1427d 100644
--- a/keygen/keygen.c
+++ b/keygen/keygen.c
@@ -217,7 +217,7 @@ sign_key(char *e_data, int e_len, char *n_data, int n_len,
{
return 1;
}
-
+
if (n_len == 64)
{
key = (char *)g_malloc(184, 0);
@@ -367,11 +367,12 @@ save_all(char *e_data, int e_len, char *n_data, int n_len,
fd = g_file_open(filename);
- if (fd > 0)
+ if (fd != -1)
{
if (g_file_write(fd, "[keys]\n", 7) == -1)
{
g_writeln("problem writing to %s, maybe no rights", filename);
+ g_file_close(fd);
return 1;
}