Skip to content

Commit

Permalink
libpriv/origin: Free treefile when dropping RpmOstreeOrigin
Browse files Browse the repository at this point in the history
The mix of C++ and C memory management is super confusing. I'm pretty
sure we've been leaking the treefile here, because `free` doesn't know
anything about the embedded `std::optional`.
  • Loading branch information
jlebon authored and cgwalters committed Apr 26, 2022
1 parent 94bebd6 commit cf7af44
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libpriv/rpmostree-origin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ rpmostree_origin_unref (RpmOstreeOrigin *origin)
origin->refcount--;
if (origin->refcount > 0)
return;
origin->treefile.reset ();
g_free (origin);
}

Expand Down

0 comments on commit cf7af44

Please sign in to comment.