summaryrefslogtreecommitdiffstats
path: root/src/userpref.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/userpref.c')
-rw-r--r--src/userpref.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/userpref.c b/src/userpref.c
index 68f5e32..b2fdd2d 100644
--- a/src/userpref.c
+++ b/src/userpref.c
@@ -105,6 +105,7 @@ int is_device_known(char* public_key) {
105 ret = 1; 105 ret = 1;
106 g_free(stored_key); 106 g_free(stored_key);
107 g_io_channel_shutdown(keyfile, FALSE, NULL); 107 g_io_channel_shutdown(keyfile, FALSE, NULL);
108 g_io_channel_unref(keyfile);
108 pcur++; 109 pcur++;
109 } 110 }
110 g_free(keyfilepath); 111 g_free(keyfilepath);
@@ -163,6 +164,7 @@ int store_device_public_key(char* public_key) {
163 wlength = strlen(public_key); // why this wasn't discovered before... ugh 164 wlength = strlen(public_key); // why this wasn't discovered before... ugh
164 g_io_channel_write_chars(file, public_key, wlength, NULL, NULL); 165 g_io_channel_write_chars(file, public_key, wlength, NULL, NULL);
165 g_io_channel_shutdown(file, TRUE, NULL); 166 g_io_channel_shutdown(file, TRUE, NULL);
167 g_io_channel_unref(file);
166 168
167 /* Append device to list */ 169 /* Append device to list */
168 new_devices_list = (const gchar**)g_malloc(sizeof(gchar*)* (len + 2)); 170 new_devices_list = (const gchar**)g_malloc(sizeof(gchar*)* (len + 2));
@@ -180,6 +182,7 @@ int store_device_public_key(char* public_key) {
180 file = g_io_channel_new_file(config_file, "w", NULL); 182 file = g_io_channel_new_file(config_file, "w", NULL);
181 g_io_channel_write_chars(file, buf, length, NULL, NULL); 183 g_io_channel_write_chars(file, buf, length, NULL, NULL);
182 g_io_channel_shutdown(file, TRUE, NULL); 184 g_io_channel_shutdown(file, TRUE, NULL);
185 g_io_channel_unref(file);
183 g_key_file_free(key_file); 186 g_key_file_free(key_file);
184 } 187 }
185 188
@@ -304,6 +307,7 @@ int init_config_file(char* host_id, gnutls_datum_t* root_key, gnutls_datum_t* ho
304 g_free(config_file); 307 g_free(config_file);
305 g_io_channel_write_chars(file, buf, length, NULL, NULL); 308 g_io_channel_write_chars(file, buf, length, NULL, NULL);
306 g_io_channel_shutdown(file, TRUE, NULL); 309 g_io_channel_shutdown(file, TRUE, NULL);
310 g_io_channel_unref(file);
307 311
308 g_key_file_free(key_file); 312 g_key_file_free(key_file);
309 313