mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
xdgmime: fix double free
We free xdg_dirs[i] twice, but fail to free xdg_dirs itself. Also, since free() is NULL-safe, there is no need for the second check here. Discovered in: https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/16#note_1432025
This commit is contained in:
parent
4a8120ec22
commit
f95ca6cb71
@ -350,8 +350,7 @@ xdg_mime_set_dirs (const char * const *dirs)
|
||||
|
||||
for (i = 0; xdg_dirs != NULL && xdg_dirs[i] != NULL; i++)
|
||||
free (xdg_dirs[i]);
|
||||
if (xdg_dirs != NULL)
|
||||
free (xdg_dirs[i]);
|
||||
free (xdg_dirs);
|
||||
xdg_dirs = NULL;
|
||||
|
||||
if (dirs != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user