mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-22 03:02:49 +00:00
Fix use-after-free in SNI
gtk_icon_theme_load_icon returns a pixbuf which is not owned by us, and therefore g_free shouldn't be called. When reloading an icon, this pixbuf was reused by the icon theme even though we just free'd it. Fixes: https://github.com/scorpion-26/gBar/issues/74
This commit is contained in:
parent
0e8634a227
commit
438024c626
1 changed files with 2 additions and 2 deletions
|
@ -279,7 +279,7 @@ namespace SNI
|
||||||
LOG("SNI: " << name << " vanished!");
|
LOG("SNI: " << name << " vanished!");
|
||||||
g_bus_unwatch_name(it->watcherID);
|
g_bus_unwatch_name(it->watcherID);
|
||||||
g_dbus_connection_signal_unsubscribe(dbusConnection, it->propertyChangeWatcherID);
|
g_dbus_connection_signal_unsubscribe(dbusConnection, it->propertyChangeWatcherID);
|
||||||
g_free(it->pixbuf);
|
g_object_unref(it->pixbuf);
|
||||||
items.erase(it);
|
items.erase(it);
|
||||||
InvalidateWidget();
|
InvalidateWidget();
|
||||||
return;
|
return;
|
||||||
|
@ -337,7 +337,7 @@ namespace SNI
|
||||||
{
|
{
|
||||||
g_bus_unwatch_name(it->watcherID);
|
g_bus_unwatch_name(it->watcherID);
|
||||||
g_dbus_connection_signal_unsubscribe(dbusConnection, it->propertyChangeWatcherID);
|
g_dbus_connection_signal_unsubscribe(dbusConnection, it->propertyChangeWatcherID);
|
||||||
g_free(it->pixbuf);
|
g_object_unref(it->pixbuf);
|
||||||
items.erase(it);
|
items.erase(it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue