shithub: puzzles

Download patch

ref: 8f670292a72c1c5450c5c62bc2a5a06005808ed7
parent: 6f47baddf90a4685c5662e5f6a782afbbe4cd619
author: Simon Tatham <anakin@pobox.com>
date: Thu Jun 30 14:11:02 EDT 2005

Preset names retrieved from the environment must be dupstr()ed. How
did I miss this before? It just caused a segfault for me, which is
entirely fair enough, but I've no idea why it didn't fail before!

[originally from svn r6043]

--- a/midend.c
+++ b/midend.c
@@ -757,7 +757,7 @@
                 }
 
                 me->presets[me->npresets] = preset;
-                me->preset_names[me->npresets] = name;
+                me->preset_names[me->npresets] = dupstr(name);
                 me->npresets++;
             }
         }