Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4e19917 authored by Greg Kaiser's avatar Greg Kaiser
Browse files

Fix resource leak

We make sure to close the file in the non-error path.

Bug: 154056389
Test: TreeHugger
Change-Id: Ie84548d4b3db19260e2026538bd3024316b12a80
parent 7affcb54
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ static gatt::Database bta_gattc_load_db(const char* fname) {
      LOG(ERROR) << __func__ << ": can't read GATT attributes: " << fname;
      goto done;
    }
    fclose(fd);

    bool success = false;
    gatt::Database result = gatt::Database::Deserialize(attr, &success);