shithub: puzzles

Download patch

ref: b5cb02b61ac70ce92631c1a39d66e7668e870c8a
parent: 236f965093b25cef95b14c303ead298ac3edc86a
author: Simon Tatham <anakin@pobox.com>
date: Wed Dec 28 13:07:46 EST 2011

Fix bug in error reporting for --save caused by freeing 'realname'
before the error messages wanted to use it.

[originally from svn r9374]

--- a/gtk.c
+++ b/gtk.c
@@ -2704,7 +2704,6 @@
 			    strerror(errno));
 		    return 1;
 		}
-		sfree(realname);
                 ctx.error = 0;
 		midend_serialise(me, savefile_write, &ctx);
 		if (ctx.error) {
@@ -2717,6 +2716,7 @@
 			    strerror(errno));
 		    return 1;
 		}
+		sfree(realname);
 	    }
 	    if (!doc && !savefile) {
 		id = midend_get_game_id(me);