Fix GString memory leak in read_stream function

The 'stream' GString was not freed before returning from read_stream()
in two places:
1. When kill_recv is TRUE at the start of the loop
2. At the end of the function after the loop exits

Added g_string_free(stream, TRUE) before both return statements.
This commit is contained in:
2025-12-25 22:47:10 +03:00
parent 6579e9f565
commit afa4a3a4ea

View File

@@ -109,6 +109,7 @@ read_stream(void)
while (TRUE) {
if (kill_recv) {
_shutdown();
g_string_free(stream, TRUE);
return 0;
}
@@ -167,6 +168,7 @@ read_stream(void)
memset(buf, 0, sizeof(buf));
}
g_string_free(stream, TRUE);
return 0;
}