diff mbox series

[FFmpeg-devel,1/3] tests/audiomatch: add free to make static analysis tools happy

Message ID 1607507590-19938-1-git-send-email-mypopydev@gmail.com
State Accepted
Commit 412c3b37a410c90820bb37308ed55df5aa75e2cc
Headers show
Series [FFmpeg-devel,1/3] tests/audiomatch: add free to make static analysis tools happy | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate warning Make fate failed

Commit Message

Jun Zhao Dec. 9, 2020, 9:53 a.m. UTC
From: Jun Zhao <barryjzhao@tencent.com>

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 tests/audiomatch.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Anton Khirnov Dec. 10, 2020, 8:10 a.m. UTC | #1
Quoting Jun Zhao (2020-12-09 10:53:08)
> From: Jun Zhao <barryjzhao@tencent.com>
> 
> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> ---
>  tests/audiomatch.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)

looks ok
mypopy@gmail.com Dec. 10, 2020, 11:44 a.m. UTC | #2
On Thu, Dec 10, 2020 at 4:11 PM Anton Khirnov <anton@khirnov.net> wrote:
>
> Quoting Jun Zhao (2020-12-09 10:53:08)
> > From: Jun Zhao <barryjzhao@tencent.com>
> >
> > Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> > ---
> >  tests/audiomatch.c | 11 +++++++++--
> >  1 file changed, 9 insertions(+), 2 deletions(-)
>
> looks ok
>
Pushed, thx
diff mbox series

Patch

diff --git a/tests/audiomatch.c b/tests/audiomatch.c
index bb9deca..56a60bd 100644
--- a/tests/audiomatch.c
+++ b/tests/audiomatch.c
@@ -82,9 +82,9 @@  int main(int argc, char **argv) {
     signal = malloc(siglen * sizeof(*signal));
 
     if (fread(data  , 1, datlen, f[0]) != datlen)
-        return 1;
+        goto read_fail;
     if (fread(signal, 1, siglen, f[1]) != siglen)
-        return 1;
+        goto read_fail;
     datlen /= 2;
     siglen /= 2;
 
@@ -111,5 +111,12 @@  int main(int argc, char **argv) {
     }
     printf("presig: %d postsig:%d c:%7.4f lenerr:%d\n", bestpos, datlen - siglen - bestpos, bestc / sigamp, datlen - siglen);
 
+    free(data);
+    free(signal);
     return 0;
+
+read_fail:
+    free(data);
+    free(signal);
+    return 1;
 }