chiark / gitweb /
misc.c: Fix implementation of free_keys.
authorLennard Sprong <x-sheep@users.noreply.github.com>
Thu, 14 Jun 2018 19:45:26 +0000 (21:45 +0200)
committerSimon Tatham <anakin@pobox.com>
Thu, 14 Jun 2018 22:39:49 +0000 (23:39 +0100)
The previous version attempted to free the first element multiple times.

misc.c

diff --git a/misc.c b/misc.c
index 734ca5dc2d6577806e0b66c14c8462aafd3b9f01..73faf3ace7a96fcde2b3fca0707501b42b507a77 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -26,7 +26,7 @@ void free_keys(key_label *keys, int nkeys)
     int i;
 
     for(i = 0; i < nkeys; i++)
-        sfree(keys->label);
+        sfree(keys[i].label);
     sfree(keys);
 }