xicodomingues/francinette

get_next_line: strict null checks

Closed this issue · 3 comments

So running francinette just like usual, I pass all the tests.
When running with --strict, I get KO_NULL_CHECK's, which I can fix by freeing my previous return result on the next call to get_next_line, but by doing so I then with non-strict francinette get Aborts because it is now double freeing.
So my questions are:

  1. Is up to the caller to free the memory or should the function free it?
  2. Is it my implementation or is it out dated tests?

This is with get_next_line version:11

Notes:
My issues stems from the following code from the tests:

file_utils.c:116
The result is NOT free'd

file_utils.c:73
The result is free'd (file_utils.c:88)

Perhaps I understand the tests wrong and it's not supposed to be freed there?

Never mind, it was just my misunderstanding of the NULL_CHECK, I had been staring at screens too long.
Forgive me for my stupidity.

zneel commented

@gmfCoding Hi, How did you solved this? I have the same issue

zneel commented

Ok i think I found the answer reading the README.md 💀