This is incorrect, because data.attrs is union - and sometimes it's NOT array, so DELETE_HTML_Attributes (which expands to 'delete []') can NOT be applied to it. I'm very surprised that noone fixed this, because it's practically impossible to use browser with this bug - it crashes on almost all more or less complex pages (e.g. bash.org.ru).
After some time debugging I think I found correct fix for this bug. Very funny but working like a charm:
SetAttrSize(new_len);
if (!need_free)
DELETE_HTML_Attributes(data.attrs);
data.attrs = new_attrs;
It seems that data.attrs is NOT an array then and only then need_free flag is false.
Feel free to add this as a patch to openopera repo.
At modules/logdoc/src/htm_elm.cpp:2623 there is lines:
This is incorrect, because data.attrs is union - and sometimes it's NOT array, so DELETE_HTML_Attributes (which expands to 'delete []') can NOT be applied to it. I'm very surprised that noone fixed this, because it's practically impossible to use browser with this bug - it crashes on almost all more or less complex pages (e.g. bash.org.ru). After some time debugging I think I found correct fix for this bug. Very funny but working like a charm:
It seems that data.attrs is NOT an array then and only then need_free flag is false. Feel free to add this as a patch to openopera repo.