Fix some possible leaks.

This commit is contained in:
Elliott Sales de Andrade 2020-11-23 03:35:30 -05:00 committed by Wim Taymans
parent fa5b04f3e5
commit 6224068586
3 changed files with 11 additions and 1 deletions

View file

@ -1702,7 +1702,8 @@ static pa_alsa_jack* ucm_get_jack(pa_alsa_ucm_config *ucm, pa_alsa_ucm_device *d
mixer_device_name = get_jack_mixer_device(device, false); mixer_device_name = get_jack_mixer_device(device, false);
if (!mixer_device_name) { if (!mixer_device_name) {
pa_log("[%s] No mixer device name for JackControl \"%s\"", device_name, jack_control); pa_log("[%s] No mixer device name for JackControl \"%s\"", device_name, jack_control);
return NULL; j = NULL;
goto finish;
} }
j = pa_alsa_jack_new(NULL, mixer_device_name, name); j = pa_alsa_jack_new(NULL, mixer_device_name, name);
PA_LLIST_PREPEND(pa_alsa_jack, ucm->jacks, j); PA_LLIST_PREPEND(pa_alsa_jack, ucm->jacks, j);

View file

@ -102,12 +102,18 @@ static GstPipeWireCore *make_core (int fd)
mainloop_failed: mainloop_failed:
{ {
GST_ERROR ("error starting mainloop"); GST_ERROR ("error starting mainloop");
pw_context_destroy (core->context);
pw_thread_loop_destroy (core->loop);
g_free (core);
return NULL; return NULL;
} }
connection_failed: connection_failed:
{ {
GST_ERROR ("error connect: %m"); GST_ERROR ("error connect: %m");
pw_thread_loop_unlock (core->loop); pw_thread_loop_unlock (core->loop);
pw_context_destroy (core->context);
pw_thread_loop_destroy (core->loop);
g_free (core);
return NULL; return NULL;
} }
} }

View file

@ -2256,6 +2256,9 @@ static int do_finish_upload_stream(struct client *client, uint32_t command, uint
error_errno: error_errno:
res = -errno; res = -errno;
if (sample != NULL) {
free(sample);
}
goto error; goto error;
error_invalid: error_invalid:
res = -EINVAL; res = -EINVAL;