Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 316
    • Issues 316
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 36
    • Merge requests 36
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #536
Closed
Open
Created Oct 25, 2007 by Roger Dingledine@armaReporter

memory leak in trusted_dirs_load_certs_from_string

==25743== 4,490 (3,978 direct, 512 indirect) bytes in 10 blocks are definitely l ost in loss record 7 of 9 ==25743== at 0x401D38B: malloc (vg_replace_malloc.c:149) ==25743== by 0x80EBB6C: _tor_malloc (util.c:112) ==25743== by 0x80DDCC3: authority_cert_parse_from_string (routerparse.c:1496) ==25743== by 0x80CD999: trusted_dirs_load_certs_from_string (routerlist.c:113 ) ==25743== by 0x80CD946: trusted_dirs_reload_certs (routerlist.c:96) ==25743== by 0x80B01D4: do_main_loop (main.c:1347) ==25743== by 0x80B1766: tor_main (main.c:1932) ==25743== by 0x80EABB5: main (tor_main.c:28)

Looking at trusted_dirs_load_certs_from_string(), towards the bottom it calls cert->cache_info.signed_descriptor_body = tor_strndup(s, eos-s);

yet in authority_cert_parse_from_string() we already cert->cache_info.signed_descriptor_body = tor_malloc(len+1); memcpy(cert->cache_info.signed_descriptor_body, s, len); cert->cache_info.signed_descriptor_body[len] = 0;

It seems that we should do only one of these?

[Automatically added by flyspray2trac: Operating System: All]

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking