On 07/07/2013 10:01 PM, Anton Ovchinnikov wrote: > Thank you for explanations! > >> For such cases we usually do: >> >> IF_LINT (free (utmp_buf)); >> >> or for larger blocks: >> >> #ifdef lint >> .... >> #endif > > Just to be sure that I understand all the stuff I about lint and > IF_LINT correctly: > To prevent 'valgrind' from complaining we use IF_LINT macro during dev > builds, so the code inside IF_LINT actually works. But at the same > time we realize that it's redundant to free() that kind of buffer, so > end users use the binary which was compiled without the corresponding > macro, hence there's no generated code for free(utmp_buf) in that > binary. Is that correct?
Exactly.
