[tool] Fix handle free for f1 and call noise_suppression_deinitialize() 82/299682/2
authorNishant Chaprana <n.chaprana@samsung.com>
Fri, 6 Oct 2023 09:12:30 +0000 (14:42 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Tue, 10 Oct 2023 05:12:12 +0000 (10:42 +0530)
Change-Id: I7dcabed007054415fb4dbd937b3a15207042b437
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
tool/noise_suppression_tool.c

index 7df8d6e..3118ddc 100644 (file)
@@ -85,12 +85,15 @@ int main(int argc, char **argv)
        f1 = fopen(argv[2], "r");
        if (!f1) {
                fprintf(stderr, "f1 fopen failed\n");
+               noise_suppression_deinitialize(ns_handle);
                return -1;
        }
 
        fout = fopen(argv[3], "w");
        if (!fout) {
                fprintf(stderr, "fout fopen failed\n");
+               noise_suppression_deinitialize(ns_handle);
+               fclose(f1);
                return -1;
        }