From: João Paulo Rechi Vita Date: Thu, 21 Aug 2008 20:06:41 +0000 (-0300) Subject: Fix some memory leaking X-Git-Tag: submit/2.0-panda/20130828.192557~2681 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e817579ee13904e7751860a1c91291143d6e53c;p=profile%2Fivi%2Fpulseaudio-panda.git Fix some memory leaking --- diff --git a/src/modules/module-bt-device.c b/src/modules/module-bt-device.c index 053ef08..5bc0f28 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);