"valgrind doesn't lie.". See
https://github.com/shlomif/fortune-mod/issues/22#issuecomment-
357811116
. Now the valgrind test passes with the new Recode at
https://github.com/rrthomas/Recode .
return (i >= j ? i : j);
}
+static void free_desc(FILEDESC *ptr)
+{
+ while (ptr)
+ {
+ free_desc(ptr->child);
+ do_free(ptr->datfile);
+ do_free(ptr->posfile);
+ do_free(ptr->name);
+ do_free(ptr->path);
+ if (ptr->inf)
+ {
+ fclose(ptr->inf);
+ ptr->inf = NULL;
+ }
+ FILEDESC *next = ptr->next;
+ free(ptr);
+ ptr = next;
+ }
+}
+
int main(int ac, char *av[])
{
const char *ctype;
recode_delete_request(request);
recode_delete_outer(outer);
+
+ /* Free the File_list */
+ free_desc(File_list);
exit(0);
/* NOTREACHED */
}
use Test::More;
use Test::RunValgrind;
-plan skip_all => 'lib-recode has memory leaks';
-# plan tests => 1;
+# plan skip_all => 'lib-recode has memory leaks';
+plan tests => 1;
# TEST
Test::RunValgrind->new({})->run(