diff options
author | Tanu Kaskinen <tanu.kaskinen@digia.com> | 2011-03-11 13:37:49 +0200 |
---|---|---|
committer | Tanu Kaskinen <tanu.kaskinen@digia.com> | 2011-03-11 13:37:49 +0200 |
commit | 983d4c238da96e4ca12283f51ccd0b6bd7005592 (patch) | |
tree | f26b4b94afb7164b72fac78fca4c4a0b92a92a5c /src/utils/pacat.c | |
parent | e01a28cd53925e5a351ac18f8fbbb8a696139a03 (diff) |
pacat: Fix memory leak when draining the context.
Diffstat (limited to 'src/utils/pacat.c')
-rw-r--r-- | src/utils/pacat.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils/pacat.c b/src/utils/pacat.c index 6cd01d21..749593ea 100644 --- a/src/utils/pacat.c +++ b/src/utils/pacat.c @@ -105,6 +105,7 @@ static void context_drain_complete(pa_context*c, void *userdata) { /* Stream draining complete */ static void stream_drain_complete(pa_stream*s, int success, void *userdata) { + pa_operation *o = NULL; if (!success) { pa_log(_("Failed to drain stream: %s"), pa_strerror(pa_context_errno(context))); @@ -118,9 +119,10 @@ static void stream_drain_complete(pa_stream*s, int success, void *userdata) { pa_stream_unref(stream); stream = NULL; - if (!pa_context_drain(context, context_drain_complete, NULL)) + if (!(o = pa_context_drain(context, context_drain_complete, NULL))) pa_context_disconnect(context); else { + pa_operation_unref(o); if (verbose) pa_log(_("Draining connection to server.")); } |