git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
c5168b4
)
tests/avstring: free the pointer after calls to av_d2str()
author
James Almer
<jamrial@gmail.com>
Thu, 22 Dec 2016 15:11:13 +0000
(12:11 -0300)
committer
James Almer
<jamrial@gmail.com>
Thu, 22 Dec 2016 15:11:13 +0000
(12:11 -0300)
Fixes memleaks.
Signed-off-by: James Almer <jamrial@gmail.com>
libavutil/tests/avstring.c
patch
|
blob
|
history
diff --git
a/libavutil/tests/avstring.c
b/libavutil/tests/avstring.c
index
290b170
..
14bc7ff
100644
(file)
--- a/
libavutil/tests/avstring.c
+++ b/
libavutil/tests/avstring.c
@@
-97,8
+97,10
@@
int main(void)
#define TEST_D2STR(value, expected) \
if((ptr = av_d2str(value)) == NULL){ \
printf("error, received null pointer!\n"); \
- } else if(strcmp(ptr, expected) != 0){ \
- printf( "expected: %s, received: %s\n", expected, ptr); \
+ } else { \
+ if(strcmp(ptr, expected) != 0) \
+ printf( "expected: %s, received: %s\n", expected, ptr); \
+ av_free(ptr); \
}
TEST_D2STR(0 , "0.000000");
TEST_D2STR(-1.2333234, "-1.233323");