summaryrefslogtreecommitdiffstats
path: root/src/userpref.c
diff options
context:
space:
mode:
authorGravatar Christophe Fergeau2008-08-12 22:25:22 +0200
committerGravatar Jonathan Beck2008-08-21 18:58:17 +0200
commit216c9e808957c996c17f9ca46707decbbafed6fe (patch)
tree600e73df05e9d2d0970a91d1254f9c7dd6502a13 /src/userpref.c
parentcb4f79a28c6bcd4677c576e57bcde7c9957789d6 (diff)
downloadlibplist-216c9e808957c996c17f9ca46707decbbafed6fe.tar.gz
libplist-216c9e808957c996c17f9ca46707decbbafed6fe.tar.bz2
g_io_channel_unref must be called after g_io_channel_shutdown
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) {
ret = 1;
g_free(stored_key);
g_io_channel_shutdown(keyfile, FALSE, NULL);
+ g_io_channel_unref(keyfile);
pcur++;
}
g_free(keyfilepath);
@@ -163,6 +164,7 @@ int store_device_public_key(char* public_key) {
wlength = strlen(public_key); // why this wasn't discovered before... ugh
g_io_channel_write_chars(file, public_key, wlength, NULL, NULL);
g_io_channel_shutdown(file, TRUE, NULL);
+ g_io_channel_unref(file);
/* Append device to list */
new_devices_list = (const gchar**)g_malloc(sizeof(gchar*)* (len + 2));
@@ -180,6 +182,7 @@ int store_device_public_key(char* public_key) {
file = g_io_channel_new_file(config_file, "w", NULL);
g_io_channel_write_chars(file, buf, length, NULL, NULL);
g_io_channel_shutdown(file, TRUE, NULL);
+ g_io_channel_unref(file);
g_key_file_free(key_file);
}
@@ -304,6 +307,7 @@ int init_config_file(char* host_id, gnutls_datum_t* root_key, gnutls_datum_t* ho
g_free(config_file);
g_io_channel_write_chars(file, buf, length, NULL, NULL);
g_io_channel_shutdown(file, TRUE, NULL);
+ g_io_channel_unref(file);
g_key_file_free(key_file);