[Top][All Lists]

[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

From: Yaron Yogev
Subject: [patch #5911] CVS 1.12.13 - fixed memory leaks errors reported by valgrind/memcheck
Date: Wed, 06 Jun 2007 11:39:11 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20070208 Iceweasel/ (Debian-

Follow-up Comment #4, patch #5911 (project cvs):

regarding calls to getgrnam():
'man getgrnam' on my Linux PC (Intel-based, Linux kernel 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.

(file #12966)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]