summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/userpref.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/userpref.c b/src/userpref.c
index f4a22fd..cd29c43 100644
--- a/src/userpref.c
+++ b/src/userpref.c
@@ -140,7 +140,7 @@ int store_device_public_key(char* public_key)
g_io_channel_shutdown(file, TRUE, NULL);
/* append device to list */
- gchar** new_devices_list = (gchar**)g_malloc(sizeof(gchar*)* (length + 1));
+ gchar** new_devices_list = (gchar**)g_malloc(sizeof(gchar*)* (length + 2));
int i;
for( i = 0; i < length; i++)
new_devices_list[i] = devices_list[i];