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 admin enable hashed storage. More information