diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c
index e86a39cab063e1a4ac2ebb251b597c37ec2f65db..dd42119a2fe9ddd012ce7715955f648cc991a649 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 ed0db653d1f51df07ae714199f5bd9f68c05de21..2be6b55f044abd14c30afa0f2cce4a63e8899c21 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 316da61d4923d07c934915f88570d75bd98d31ef..110eafb7a25d0faccfb34d32a05fae7e94870644 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);
 }