From 5c8c35e773997da2a1ffaaf22f0e2ceddd39ffdb Mon Sep 17 00:00:00 2001
From: Steel Titanium <steeltitanium1@gmail.com>
Date: Sat, 23 Jun 2018 15:09:11 -0400
Subject: [PATCH] Deallocate when I_Quit() is called instead.

---
 src/sdl/i_system.c   | 1 +
 src/sdl12/i_system.c | 1 +
 src/win32/win_sys.c  | 1 +
 3 files changed, 3 insertions(+)

diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c
index e86a39cab0..dd42119a2f 100644
--- a/src/sdl/i_system.c
+++ b/src/sdl/i_system.c
@@ -2132,6 +2132,7 @@ void I_Quit(void)
 		printf("\r");
 		ShowEndTxt();
 	}
+	free(myargv); // Deallocate allocated memory
 death:
 	W_Shutdown();
 	exit(0);
diff --git a/src/sdl12/i_system.c b/src/sdl12/i_system.c
index ed0db653d1..2be6b55f04 100644
--- a/src/sdl12/i_system.c
+++ b/src/sdl12/i_system.c
@@ -2301,6 +2301,7 @@ void I_Quit(void)
 		printf("\r");
 		ShowEndTxt();
 	}
+	free(myargv); // Deallocate allocated memory
 death:
 	W_Shutdown();
 #ifdef GP2X
diff --git a/src/win32/win_sys.c b/src/win32/win_sys.c
index 316da61d49..110eafb7a2 100644
--- a/src/win32/win_sys.c
+++ b/src/win32/win_sys.c
@@ -771,6 +771,7 @@ void I_Quit(void)
 		ShowEndTxt(co);
 	}
 	fflush(stderr);
+	free(myargv); // Deallocate allocated memory
 	W_Shutdown();
 	exit(0);
 }
-- 
GitLab