Hi Andreas, On Friday 06 April 2012 03:06:47 pm Andreas Grünbacher wrote: > Am 6. April 2012 14:09 schrieb Jean Delvare <[email protected]>: > > This commit [...] is broken. > > bad[] holds pointers to the name strings, and these get freed > > when switching to the next hunk in the patch file (if I read the > > code properly...) So you end up accessing freed memory. Valgrind > > complains about that and the code will eventually fail, as was > > reported by an openSUSE user: > > > > https://bugzilla.novell.com/show_bug.cgi?id=755136 > > > > I don't think the code even actually does what it is supposed to, > > as it can only store 2 bad names (the slots are never freed), while > > a given patch file could contain a lot more. > > Thanks. We are actually only interested in each patch here, not in > all the patches that could be in the same input file. How about the > attached change for a fix?
I tested your fix and it works OK, the result is as expected now and valgrind is happy too. Thanks! -- Jean Delvare Suse L3
