diff options
author | Wim Taymans <wtaymans@redhat.com> | 2020-06-16 12:40:39 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2020-06-16 12:40:39 +0200 |
commit | 9315bbdfe5c2987bc1501653f9672f79a6f9ee6d (patch) | |
tree | 3916db909f69ce2520ff25f77a8f4f6fc4fc1c61 | |
parent | 1778f76c7826abf0f854993aa524dc8e5dabe8ee (diff) |
modules: fix some small memory leaks
-rw-r--r-- | src/modules/module-card-restore.c | 3 | ||||
-rw-r--r-- | src/modules/module-null-sink.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c index 6aeef494e..80506cd04 100644 --- a/src/modules/module-card-restore.c +++ b/src/modules/module-card-restore.c @@ -562,7 +562,7 @@ static pa_hook_result_t card_choose_initial_profile_callback(pa_core *core, pa_c if (!u->restore_bluetooth_profile) { const char *s = pa_proplist_gets(card->proplist, PA_PROP_DEVICE_BUS); if (pa_safe_streq(s, "bluetooth")) - return PA_HOOK_OK; + goto finish; } if (e->profile[0]) { @@ -582,6 +582,7 @@ static pa_hook_result_t card_choose_initial_profile_callback(pa_core *core, pa_c } } +finish: entry_free(e); return PA_HOOK_OK; diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c index 336676b7a..bbbf83435 100644 --- a/src/modules/module-null-sink.c +++ b/src/modules/module-null-sink.c @@ -343,8 +343,10 @@ int pa__init(pa_module*m) { if (!format) { pa_log(_("Failed to set format: invalid format string %s"), f); + pa_xfree(f); goto fail; } + pa_xfree(f); pa_idxset_put(u->formats, format, NULL); } |