chiark / gitweb /
Preset names retrieved from the environment must be dupstr()ed. How
authorSimon Tatham <anakin@pobox.com>
Thu, 30 Jun 2005 18:11:02 +0000 (18:11 +0000)
committerSimon Tatham <anakin@pobox.com>
Thu, 30 Jun 2005 18:11:02 +0000 (18:11 +0000)
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]

midend.c

index 8928fded10d35a52e8c064cee88f04e9dfe87aa5..a764c778a6ab11e5f5bb3f37e9377fb017707374 100644 (file)
--- a/midend.c
+++ b/midend.c
@@ -757,7 +757,7 @@ int midend_num_presets(midend_data *me)
                 }
 
                 me->presets[me->npresets] = preset;
-                me->preset_names[me->npresets] = name;
+                me->preset_names[me->npresets] = dupstr(name);
                 me->npresets++;
             }
         }