mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-22 03:19:24 +01:00
Avoid double free
This commit is contained in:
parent
596796287e
commit
65ad6963b1
@ -1125,11 +1125,11 @@ bool Network::AppendScreenshot(NetworkUpdatePeerInfo *pi)
|
||||
|
||||
scr = Gui::gui->screenshot;
|
||||
if (!scr)
|
||||
goto out_none;
|
||||
goto out;
|
||||
|
||||
png = sdl_surface_to_png(scr, &sz);
|
||||
if (!png)
|
||||
goto out_scr;
|
||||
goto out;
|
||||
if ((sz & 3) != 0)
|
||||
sz += 4 - (sz & 3);
|
||||
|
||||
@ -1143,10 +1143,8 @@ bool Network::AppendScreenshot(NetworkUpdatePeerInfo *pi)
|
||||
|
||||
out = true;
|
||||
free(png);
|
||||
out_scr:
|
||||
SDL_FreeSurface(scr);
|
||||
out_none:
|
||||
|
||||
out:
|
||||
return out;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user