In src/linux/zfilew.c

If $HOME is defined, obtaindir attempts to free the result of
getenv("HOME"), which is bad because that value is a static value and
must not be freed.  The new glibc does tighter checking of such things,
which is why it is broken under the new glibc.

I've attached a patch, should I submit it upstream, because it's
definitely the upstream source that is broken, or will you guys do that?

While I'm thinking about it, someone should open a wishlist bug to allow
for the building of gdb-friendly binaries without the manual fiddling I
had to do.
-- 
Jonathan Guthrie <[EMAIL PROTECTED]>
Sto Pro Veritate
diff -Naur zsnes-1.420/src/linux/zfilew.c zsnes-1.420-new/src/linux/zfilew.c
--- zsnes-1.420/src/linux/zfilew.c	2007-05-02 20:10:22.601840283 -0500
+++ zsnes-1.420-new/src/linux/zfilew.c	2007-05-02 20:08:08.313654702 -0500
@@ -476,13 +476,9 @@
   {
     homedir = (char *)malloc(ZCFG_DIR_LEN);
     getcwd(homedir, ZCFG_DIR_LEN);
-    strcpy(zcfgdir, homedir);
-    free(homedir);
-  }
-  else
-  {
-    strcpy(zcfgdir, homedir);
   }
+  strcpy(zcfgdir, homedir);
+  free(homedir);
   strcat(zcfgdir, ZCFG_DIR);
   tmp = opendir(zcfgdir);
   if (tmp == NULL) 

Reply via email to