Fix some memory leaking

This commit is contained in:
João Paulo Rechi Vita 2008-08-21 17:06:41 -03:00 committed by Lennart Poettering
parent e752caca80
commit 0e817579ee

View file

@ -94,9 +94,9 @@ struct userdata {
pa_memchunk memchunk; pa_memchunk memchunk;
pa_mempool *mempool; pa_mempool *mempool;
const char *name; char *name;
const char *addr; char *addr;
const char *profile; char *profile;
int rate; int rate;
int channels; int channels;
pa_sample_spec ss; pa_sample_spec ss;
@ -994,10 +994,20 @@ void pa__done(pa_module *m) {
if (u->memchunk.memblock) if (u->memchunk.memblock)
pa_memblock_unref(u->memchunk.memblock); pa_memblock_unref(u->memchunk.memblock);
/* TODO: free mempool */
if (u->smoother) if (u->smoother)
pa_smoother_free(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) if (u->stream_fd >= 0)
pa_close(u->stream_fd); pa_close(u->stream_fd);