The read_file function opens the file and thus has to close the filehandler after an realloc error. This was forgotten in the fix 0ad384e11ed039d4c3025a7eaf19fe6bcfd41acf ("batadv-vis: Avoid memory leak after failed realloc").
Applied in revision 3b72283
Thanks, Simon