Plug a memleak in g_io_modules_scan_all_in_directory

...and at the same time, fix a malloc<>g_free mismatch.
Patch by Caolan McNamara, bug 611897
This commit is contained in:
Matthias Clasen 2010-03-07 17:42:25 -05:00
parent 5f424088f5
commit 9dd6c60fbf

View File

@ -321,14 +321,14 @@ g_io_modules_scan_all_in_directory (const char *dirname)
continue; /* Invalid line, ignore */
*colon = 0; /* terminate filename */
file = strdup (line);
file = g_strdup (line);
colon++; /* after colon */
while (g_ascii_isspace (*colon))
colon++;
extension_points = g_strsplit (colon, ",", -1);
g_hash_table_insert (cache, g_strdup (file), extension_points);
g_hash_table_insert (cache, file, extension_points);
}
g_strfreev (lines);
}