[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch #5911] CVS 1.12.13 - fixed memory leaks errors reported by valgri
[patch #5911] CVS 1.12.13 - fixed memory leaks errors reported by valgrind/memcheck
Wed, 06 Jun 2007 11:39:11 +0000
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:184.108.40.206) Gecko/20070208 Iceweasel/220.127.116.11 (Debian-18.104.22.168+dfsg-3)
Follow-up Comment #4, patch #5911 (project cvs):
regarding calls to getgrnam():
'man getgrnam' on my Linux PC (Intel-based, Linux kernel 22.214.171.124) states:
'The return value may point to static area'.
since valgrind shows many leaks coming from this function call in my
environment, apparently it is not doing static allocation in this
I think that finding in the configure script how it works is possible but not
easy to implement, so it's not worth it.
memset() after xnrealloc in history.c is wrong indeed.
however, zeroing still needs to be done on newly allocated memory for hrecs,
so I need to rewrite that bit to zero just the new elements of the array. so
the correct form should be:
memset (hrec_head + (hrec_max - HREC_INCREMENT) * sizeof(struct hrec), 0,
HREC_INCREMENT * sizeof(struct hrec));
attached is yet another patch file that fixes this.
Additional Item Attachment:
File name: patch_cvs_fix_memory_leaks_1_12_13_fix_hrecs_memset Size:0 KB
Reply to this item at:
Message sent via/by Savannah