Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #29824

Closed (moved)
(moved)
Open
Created Mar 19, 2019 by Taylor Yu@catalyst

CID 1444119 resource leak in BUG case in consdiff.c

*** CID 1444119:  Resource leaks  (RESOURCE_LEAK)
/src/feature/dircommon/consdiff.c: 1392 in consensus_diff_apply()
1386       int r1;
1387       char *result = NULL;
1388       memarea_t *area = memarea_new();
1389     
1390       r1 = consensus_compute_digest_as_signed(consensus, consensus_len, &d1);
1391       if (BUG(r1 < 0))
>>>     CID 1444119:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "area" going out of scope leaks the storage it points to.
1392         return NULL; // LCOV_EXCL_LINE
1393     
1394       lines1 = smartlist_new();
1395       lines2 = smartlist_new();
1396       if (consensus_split_lines(lines1, consensus, consensus_len, area) < 0)
1397         goto done;

This looks to be a leak if there is a BUG() condition, and the line is already marked LCOV_EXCL_LINE. Should we mark this as ignored or something in Coverity, or do we want to put cleanup code under that BUG() condition?

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