Permalink
Browse files

Backport this fix

svn path=/branches/mono-1-1-18/mono/; revision=66810
  • Loading branch information...
1 parent d973adf commit c83bb070672f0eb14b38b0f97a4cb938154982d1 @migueldeicaza migueldeicaza committed Oct 19, 2006
Showing with 9 additions and 2 deletions.
  1. +4 −0 mono/io-layer/ChangeLog
  2. +5 −2 mono/io-layer/io-portability.c
View
@@ -1,3 +1,7 @@
+2006-10-18 Miguel de Icaza <miguel@novell.com>
+
+ * io-portability.c (find_in_dir): First string dup, then closedir.
+
2006-10-12 Dick Porter <dick@ximian.com>
* processes.c (_wapi_process_reap): Unref a process handle if we
@@ -88,13 +88,16 @@ static gchar *find_in_dir (DIR *current, const gchar *name)
#endif
if (!g_ascii_strcasecmp (name, entry->d_name)) {
+ char *ret;
+
#ifdef DEBUG
g_message ("%s: matched [%s] to [%s]\n", __func__,
entry->d_name, name);
#endif
-
+
+ ret = g_strdup (entry->d_name);
closedir (current);
- return(g_strdup (entry->d_name));
+ return ret;
}
}

0 comments on commit c83bb07

Please sign in to comment.