Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2470

Coverity 1352898: Resource leak

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT2.8.0
    • Labels:
      None

      Description

      test/recovery/truncated_log.c:

      145                        while ((ret = logc->next(logc)) == 0) {
      146                                if ((ret = logc->get_key(logc,
      147                                    &lsn.l.file, &lsn.l.offset, &unused)) != 0)
      148                                        testutil_die(errno, "get_key");
      149                                if (lsn.l.file < 2)
      150                                        save_lsn = lsn;
      151                                else {
      152                                        if (first)
      153                                                testutil_die(EINVAL,
      154                                                    "min_key too high");
      155                                        if (fprintf(fp,
      156                                            "%" PRIu32 " %" PRIu32 "\n",
      157                                            save_lsn.l.offset, i - 1) == -1)
      158                                                testutil_die(errno, "fprintf");
      159                                        if (fclose(fp) != 0)
      160                                                testutil_die(errno, "fclose");
      161                                        abort();
      162                                }
      163                        }
      164                        first = false;
      165                }
         	11. Jumping back to the beginning of the loop
         	15. Jumping back to the beginning of the loop
         	22. Jumping back to the beginning of the loop
         	29. Jumping back to the beginning of the loop
      166        }
         	
      CID 1352898 (#1 of 1): Resource leak (RESOURCE_LEAK)
      31. leaked_storage: Variable fp going out of scope leaks the storage it points to.
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                keith.bostic Keith Bostic
                Reporter:
                keith.bostic Keith Bostic
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: