Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in rtl_tcp on TCP client close #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benschumacher
Copy link

This changeset fixes two issues I observed in rtl_tcp:

  1. fix a memory leak that occurs when a client disconnects from the server.
  2. refines the shutdown code by clarifying the behavior around do_exit and introducing a new conn_reset boolean.

To facilitate the latter change, this binary requires C11 to allow the use of atomic types.

@petersloan
Copy link

Any chance this can get merged?

static struct llist *ll_buffers = 0;
static int llbuf_num = 500;

static volatile int do_exit = 0;
atomic_bool do_exit = false;
Copy link
Owner

Choose a reason for hiding this comment

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

Why the static is remove? It looks like the variable is still only used within this file.

static struct llist *ll_buffers = 0;
static int llbuf_num = 500;

static volatile int do_exit = 0;
atomic_bool do_exit = false;
atomic_bool conn_reset = false;
Copy link
Owner

Choose a reason for hiding this comment

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

Should this one be static too?

@pinkavaj
Copy link
Owner

pinkavaj commented Jan 5, 2025

Btw it might be worth send this to https://github.com/librtlsdr/librtlsdr (I use it as an upstream, so the update will get here)

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.

3 participants