diff options
author | João Paulo Rechi Vita <joao.vita@gmail.com> | 2008-08-21 17:06:41 -0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-09-11 01:12:08 +0300 |
commit | 0e817579ee13904e7751860a1c91291143d6e53c (patch) | |
tree | 7f2ed8b76f9b94fcbd071e185f8a62a555dc3462 | |
parent | e752caca80df70070c34554db81e2089db8d1961 (diff) |
Fix some memory leaking
-rw-r--r-- | src/modules/module-bt-device.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/modules/module-bt-device.c b/src/modules/module-bt-device.c index 053ef080..5bc0f285 100644 --- a/src/modules/module-bt-device.c +++ b/src/modules/module-bt-device.c @@ -94,9 +94,9 @@ struct userdata { pa_memchunk memchunk; pa_mempool *mempool; - const char *name; - const char *addr; - const char *profile; + char *name; + char *addr; + char *profile; int rate; int channels; pa_sample_spec ss; @@ -994,10 +994,20 @@ void pa__done(pa_module *m) { if (u->memchunk.memblock) pa_memblock_unref(u->memchunk.memblock); + /* TODO: free mempool */ if (u->smoother) pa_smoother_free(u->smoother); + if (u->name) + pa_xfree(u->name); + + if (u->addr) + pa_xfree(u->addr); + + if (u->profile) + pa_xfree(u->profile); + if (u->stream_fd >= 0) pa_close(u->stream_fd); |