From 8095c970aa2fdf67dfbf24334aa2ca59f271c11c Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 13 Dec 2017 11:59:03 +0100 Subject: [PATCH] Fix memory leak in New Ride window The way the window handles strings might need to be updated at some point to be a little bit cleaner, but this at least plugs the leak. --- src/openrct2-ui/windows/NewRide.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index f01ce4cb70..d4107e6307 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -960,6 +960,7 @@ static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixeli { const char * drawString = _strdup(availabilityString); gfx_draw_string_left_clipped(dpi, STR_AVAILABLE_VEHICLES, (void*)&drawString, COLOUR_BLACK, x, y + 39, WW - 2); + free((void *)drawString); } // Track designs are disabled in multiplayer, so don't say there are any designs available when in multiplayer