mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 15:48:54 +02:00
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:
@@ -321,14 +321,14 @@ g_io_modules_scan_all_in_directory (const char *dirname)
|
|||||||
continue; /* Invalid line, ignore */
|
continue; /* Invalid line, ignore */
|
||||||
|
|
||||||
*colon = 0; /* terminate filename */
|
*colon = 0; /* terminate filename */
|
||||||
file = strdup (line);
|
file = g_strdup (line);
|
||||||
colon++; /* after colon */
|
colon++; /* after colon */
|
||||||
|
|
||||||
while (g_ascii_isspace (*colon))
|
while (g_ascii_isspace (*colon))
|
||||||
colon++;
|
colon++;
|
||||||
|
|
||||||
extension_points = g_strsplit (colon, ",", -1);
|
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);
|
g_strfreev (lines);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user