echo-cancel: Fix memory leak in test program
authorPeter Meerwald <pmeerw@pmeerw.net>
Mon, 28 Nov 2011 15:14:16 +0000 (16:14 +0100)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Tue, 29 Nov 2011 04:38:04 +0000 (10:08 +0530)
memory for pa_echo_canceller is allocated in init_common() a second time,
hence the allocated memory in main() is leaked

src/modules/echo-cancel/module-echo-cancel.c

index 1fad12a..8bf6670 100644 (file)
@@ -2036,12 +2036,6 @@ int main(int argc, char* argv[]) {
         goto usage;
     }
 
-    u.ec = pa_xnew0(pa_echo_canceller, 1);
-    if (!u.ec) {
-        pa_log("Failed to alloc echo canceller");
-        goto fail;
-    }
-
     u.captured_file = fopen(argv[2], "r");
     if (u.captured_file == NULL) {
         perror ("fopen failed");