Index: branches/chucko/i386/modules/Keylayout/layouts/cham-mklayout.c =================================================================== --- branches/chucko/i386/modules/Keylayout/layouts/cham-mklayout.c (revision 2292) +++ branches/chucko/i386/modules/Keylayout/layouts/cham-mklayout.c (revision 2293) @@ -363,8 +363,11 @@ } struct keyboard_layout* new_layout = create_keylayout(in); - if (new_layout) + if (new_layout) { write_layout(new_layout, out); + free(new_layout); + new_layout = NULL; + } fclose(out); fclose(in);