yOn Wed, Jun 11, 2008 at 11:36:29PM +0100, Jeremy Henty wrote:
On Wed, Jun 11, 2008 at 09:51:17PM +0200, Johannes Hofmann wrote:
I think even hashValue() should not access uninitialized data. Not only because of the annoying valgrind messages.
Got it! It's StyleAttrs::textAlignChar ! If I add "textAlignChar = '.';" to StyleAttrs::initValues() (which StyleAttrs::resetValues() already does!) then the valgrind warnings disappear. Only a_Html_tag_set_align_attr() sets textAlignChar , but it only does so if it sees "align='char'".
Great. So it's just this inititialization missing. Patchlet attached.
BTW, StyleAttrs::initValues() fails to set some other data members such as font and color , but fixing this has no effect on the valgrind warnings.
As far as I can see this is intentional. font and color have to be set explicitely by the caller of Style::create(). And if valgrind does not complain, that seems to be the case. Cheers, Johannes