Opened 23 months ago
Last modified 23 months ago
#10342 reopened defect
memory leak in fftools/ffmpeg_opt.c file's opt_map_channel function
Reported by: | Hripsime | Owned by: | |
---|---|---|---|
Priority: | important | Component: | ffmpeg |
Version: | git-master | Keywords: | memory leak |
Cc: | Hripsime | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
The opt_map_channel function in the fftools/ffmpeg_opt.c source file appears to contain a memory leak. Specifically, memory is allocated using av_strdup() in line 472:
mapchan = av_strdup(arg);
However, the function contains multiple exit_program() calls that terminate the program without freeing the allocated memory in lines 507, 513, 519, and 533.
Change History (3)
comment:1 by , 23 months ago
Analyzed by developer: | unset |
---|---|
Reproduced by developer: | unset |
Resolution: | → invalid |
Status: | new → closed |
comment:2 by , 23 months ago
All the memory is freed by the operating system.
*modern operating system. And anyway, GPU memory will not be, handles will not be closed, even files opened will not be closed. And of course it makes closing slower, since OS will still check the state before closing the threads.
comment:3 by , 23 months ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
It's important to cleanup resources manually so we can detect if there is any memleak in our libs.
Should be fixed by http://ffmpeg.org/pipermail/ffmpeg-devel/2023-May/309209.html
Exiting without freeing all memory is not a leak. All the memory is freed by the operating system.