bug-cvs
[Top][All Lists]
Advanced

[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:1.8.1.2) Gecko/20070208 Iceweasel/2.0.0.2 (Debian-2.0.0.2+dfsg-3)

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

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

  <http://savannah.nongnu.org/patch/?5911>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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