mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 16:22:37 +00:00
tests/avstring: free the pointer after calls to av_d2str()
Fixes memleaks. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
c5168b4b54
commit
0abcebe3d6
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user