Skip to content

GUACAMOLE-847: Fix severe memory leak when using audio with RDP#229

Merged
mike-jumper merged 1 commit intoapache:masterfrom
fhriley:master
Jul 20, 2019
Merged

GUACAMOLE-847: Fix severe memory leak when using audio with RDP#229
mike-jumper merged 1 commit intoapache:masterfrom
fhriley:master

Conversation

@fhriley
Copy link
Contributor

@fhriley fhriley commented Jul 20, 2019

This fixes a memory leak that leaks 4+ GBs over an 8 hour period when continuous audio is being played through RDP.

Copy link
Contributor

@mike-jumper mike-jumper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In spirit, these changes look fine, and I can confirm by checking the FreeRDP source that none of the 1.x releases will free the memory for that wStream on their own. However:

  • Please correct the style of the changes to match that of the existing code (we don't cuddle the else).
  • Please correct the indentation. I'm not sure what happened, but the comments for the various case statements are now misaligned.

@fhriley
Copy link
Contributor Author

fhriley commented Jul 20, 2019

Done, I believe the style matches other code now.

There are 2 confirmations that this is the correct fix:

  1. I ran it overnight with no issues and no memory leaks.
  2. The equivalent call in FreeRDP's rdpsnd does a free.

Copy link
Contributor

@mike-jumper mike-jumper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, and seems to be the only reasonable way to resolve given the circumstances. I can only hope FreeRDP doesn't add their own Stream_Free() within the caller in the future.

@mike-jumper mike-jumper merged commit 41b0c21 into apache:master Jul 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants