[cvsacl-users] Malloc/free problems?
Brought to you by:
sbaris
|
From: Rob C. <sa...@ya...> - 2007-10-12 01:19:49
|
Hi,=0A=0AAfter patching in 1.2.5 into cvs 1.11.22 I get a number of malloc =
debug warnings when I run cvs. A sample is:=0A=0Acvs(11963) malloc: *** De=
allocation of a pointer not malloced: 0x401dc0; This could be a double free=
(), or free() called with the middle of an allocated block; Try setting env=
ironment variable MallocHelp to see tools to help debug=0A=0A=0ALooking at =
acl.c, it looks like a number of the free() calls are probably incorrect:=
=0A=0Aget_perms():=0A=0A free(foundall);=0A free(usr);=0A =
free(per); =0A=0A=0Afoundall, usr and per are pointers returned by strs=
tr or strtok, neither of which mallocs the memory they return, so the free(=
) is almost certainly operating on the wrong pointer.=0A=0ASimilarly, the c=
alls to free(tmp2) in findusername() and findgroupname() look a bit dangero=
us.=0A=0AAlso, when findusername() and findgroupname() return a match there=
is possibly a memory leak, as I'm not sure how the memory these functions =
allocate using xstrdup is ever freed when a match is found...=0A=0ARegards,=
=0A Rob.=0A=0A=0A=0A=0A Sick of deleting your inbox? Yahoo!7 Mail has =
free unlimited storage.=0Ahttp://au.docs.yahoo.com/mail/unlimitedstorage.ht=
ml=0A
|