<div dir="ltr"><div><div><div><div><div><div>hello<br><br></div>my little library uses kpathsea_find_file(). The actual code to retrieve the full path of a TFM file is the following:<br><br>-------------<br>    kpathsea kpse;<br>    char *n;<br><br>    kpse = kpathsea_new();<br>    kpathsea_set_program_name(kpse, "kpsewhich", NULL);<br>    kpathsea_init_prog (kpse, "LIBDVI", 300, NULL, NULL);<br>    n = kpathsea_find_file(kpse, name, kpse_tfm_format, 1);<br>    kpathsea_finish(kpse);<br>-------------<br><br></div>Drmemory (or valgrind) reports the following unfreed memory :<br><br># 1 ll!xmalloc                          +0x16<br># 2 ll!hash_create                      +0x11<br># 3 ll!concatn                          +0x8a0<br># 4 ll!kpathsea_cnf_get                 +0x2e<br># 5 ll!kpathsea_var_value               +0xa5<br># 6 ll!kpse_set_suffixes                +0x54<br># 7 ll!kpathsea_init_format_return_varlist+0x1f0<br># 8 ll!kpathsea_find_file_generic       +0x70<br># 9 ll!kpathsea_find_file               +0x1b<br>#10 dvi_kpathsea_path_name_get           [src/lib/dvi_kpathsea.c:354]<br>#11 dvi_font_define                      [src/lib/dvi_font.c:332]<br><br></div>trying to free 'n' with free() leads to errors in drmemory (or valgrind).<br><br></div>Is this unfreed memory normal ? or my code is not fully correct ?<br><br></div>thank you<br><br></div>Vincent Torri<br><div><div><div><div><br><br><div><br></div></div></div></div></div></div>