[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] uptime: fix a memory leak after printing results
From: |
Anton Ovchinnikov |
Subject: |
Re: [PATCH] uptime: fix a memory leak after printing results |
Date: |
Mon, 8 Jul 2013 01:01:50 +0400 |
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?
--
Best regards,
Anton