Skip to content

Commit

Permalink
core: Fix Coverity WRAPPER_ESCAPE
Browse files Browse the repository at this point in the history
This should fix:

```
32. rpm-ostree-2024.7/src/libpriv/rpmostree-core.cxx:1786:15: use_after_free: Using internal representation of destroyed object temporary of type "std::string".
```

Signed-off-by: Colin Walters <walters@verbum.org>
  • Loading branch information
cgwalters committed Aug 15, 2024
1 parent b10d8da commit 3753ebf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libpriv/rpmostree-core.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,8 @@ rpmostree_context_prepare (RpmOstreeContext *self, gboolean enable_filelists,
auto pkg = "";
for (auto &pkg_str : packages)
{
pkg = std::string (pkg_str).c_str ();
auto pkg_buf = std::string (pkg_str);
pkg = pkg_buf.c_str ();
char *query = strchr ((char *)pkg, '/');
if (query)
{
Expand Down

0 comments on commit 3753ebf

Please sign in to comment.