1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-03 18:25:35 +00:00

fix: dereference before null check

This commit is contained in:
Charles Kerr 2022-04-01 21:53:21 -05:00
parent ca20b2b895
commit cd78967815

View file

@ -77,6 +77,11 @@ void favicon_web_done_cb(tr_web::FetchResponse const& response);
bool favicon_web_done_idle_cb(std::unique_ptr<favicon_data> fav)
{
if (!fav)
{
return false;
}
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
if (!fav->contents.empty()) /* we got something... try to make a pixbuf from it */
@ -94,10 +99,7 @@ bool favicon_web_done_idle_cb(std::unique_ptr<favicon_data> fav)
}
// Not released into the next web request, means we're done trying (even if `pixbuf` is still invalid)
if (fav != nullptr)
{
fav->func(pixbuf);
}
fav->func(pixbuf);
return false;
}