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

Possible Memory leak in janus_videoroom_init(plugins/janus_videoroom.c) #1445

Closed
lqp276 opened this issue Nov 22, 2018 · 2 comments
Closed

Comments

@lqp276
Copy link

lqp276 commented Nov 22, 2018

in plugins/janus_videoroom.c, function janus_videoroom_init

/* Launch the thread that will handle incoming messages */
	error = NULL;
	handler_thread = g_thread_try_new("videoroom handler", janus_videoroom_handler, NULL, &error);
	if(error != NULL) {
		g_atomic_int_set(&initialized, 0);
		JANUS_LOG(LOG_ERR, "Got error %d (%s) trying to launch the VideoRoom handler thread...\n",
			error->code, error->message ? error->message : "??");
		janus_config_destroy(config);
		return -1;
	}
	JANUS_LOG(LOG_INFO, "%s initialized!\n", JANUS_VIDEOROOM_NAME);
	return 0;

The error pointer is initialize to NULL, and populated by g_thread_try_new, which means this object is allocated by glib, but there is no matching free,I looked up the code of glib2.48.2, this error object could be freed by g_error_free.
Hope this helps.

@lminiero
Copy link
Member

Looking at the GError documentation it looks like you're right. I'll take note of this. Thanks!

@lminiero
Copy link
Member

I added the fix to a larger branch I'm working on, which includes many fixes and a considerable refactoring.

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

No branches or pull requests

2 participants