We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Now and then I build a sanitized version of tidy, for testing...
sanitized
Using a command like -
cmake ../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-fsanitize=address -DCMAKE_VERBOSE_MAKEFILE=ON make
turned up a sanitizer error -
sanitizer
make[2]: Entering directory '/home/geoff/projects/html_tidy/tidy-html5/build/sanitize' Generate /home/geoff/projects/html_tidy/tidy-html5/build/sanitize/tidy-help.xml ./tidy -xml-help > /home/geoff/projects/html_tidy/tidy-html5/build/sanitize/tidy-help.xml ================================================================= ==6114==ERROR: LeakSanitizer: detected memory leaks Direct leak of 298 byte(s) in 18 object(s) allocated from: #0 0x7fcda2cc0b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50) #1 0x5642905311f3 in stringWithFormat /home/geoff/projects/html_tidy/tidy-html5/console/tidy.c:112 #2 0x564290531bbf in localize_option_names /home/geoff/projects/html_tidy/tidy-html5/console/tidy.c:408 #3 0x5642905386cf in xml_help /home/geoff/projects/html_tidy/tidy-html5/console/tidy.c:1875 #4 0x56429053999d in main /home/geoff/projects/html_tidy/tidy-html5/console/tidy.c:2258 #5 0x7fcda2812b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) SUMMARY: AddressSanitizer: 298 byte(s) leaked in 18 allocation(s). CMakeFiles/man.dir/build.make:64: recipe for target 'man' failed make[2]: *** [man] Error 1 make[2]: Leaving directory '/home/geoff/projects/html_tidy/tidy-html5/build/sanitize' CMakeFiles/Makefile2:181: recipe for target 'CMakeFiles/man.dir/all' failed make[1]: *** [CMakeFiles/man.dir/all] Error 2 make[1]: Leaving directory '/home/geoff/projects/html_tidy/tidy-html5/build/sanitize' Makefile:154: recipe for target 'all' failed make: *** [all] Error 2
Looks like the xml_help generator misses freeing one of the allocations...
xml_help
That fixed turned up another in printXMLCrossRefEqConsole similar...
printXMLCrossRefEqConsole
Suggests a patch like -
diff --git a/console/tidy.c b/console/tidy.c index a7880f6..ee4f780 100644 --- a/console/tidy.c +++ b/console/tidy.c @@ -1741,6 +1741,10 @@ static void printXMLCrossRefEqConsole(TidyDoc tdoc, /**< The Tidy document. */ free((tmbstr)localHit.name3); free(localName); } + if ( localHit.eqconfig ) + { + free((tmbstr)localHit.eqconfig); + } } else @@ -1887,6 +1891,7 @@ static void xml_help( void ) if (localPos.name1) free((tmbstr)localPos.name1); if (localPos.name2) free((tmbstr)localPos.name2); if (localPos.name3) free((tmbstr)localPos.name3); + if (localPos.eqconfig) free((tmbstr)localPos.eqconfig); } printf( "</cmdline>\n" );
Then I get a clean build...
Much appreciated if someone could apply the patch, test, and report... thanks...
The text was updated successfully, but these errors were encountered:
Is. #791 - free some allocations
1d74ed8
Or you could pull the issue-791 branch, test and report... thanks...
issue-791
Sorry, something went wrong.
Have now created PR #809 to free an allocation used in -xml-help generation...
-xml-help
dcf56a1
Is. #791 PR #809 - Bump to 5.7.26 for this fix
a067cc8
No branches or pull requests
Now and then I build a
sanitized
version of tidy, for testing...Using a command like -
turned up a
sanitizer
error -Looks like the
xml_help
generator misses freeing one of the allocations...That fixed turned up another in
printXMLCrossRefEqConsole
similar...Suggests a patch like -
Then I get a clean build...
Much appreciated if someone could apply the patch, test, and report... thanks...
The text was updated successfully, but these errors were encountered: