Skip to content

Commit 34bca92

Browse files
authored
Merge pull request #14156 from NixOS/fix-ub
treewide: Squash some user-after-free bugs
2 parents cd9c208 + be1ade7 commit 34bca92

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/libexpr/eval-profiler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void SampleStack::saveProfile()
324324
std::visit([&](auto && info) { info.symbolize(state, os, posCache); }, pos);
325325
}
326326
os << " " << count;
327-
writeLine(profileFd.get(), std::move(os).str());
327+
writeLine(profileFd.get(), os.str());
328328
/* Clear ostringstream. */
329329
os.str("");
330330
os.clear();

src/libstore/build/derivation-goal.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,10 @@ Goal::Co DerivationGoal::repairClosure()
272272
bmRepair));
273273
}
274274

275+
bool haveWaitees = !waitees.empty();
275276
co_await await(std::move(waitees));
276277

277-
if (!waitees.empty()) {
278+
if (haveWaitees) {
278279
trace("closure repaired");
279280
if (nrFailed > 0)
280281
throw Error(

0 commit comments

Comments
 (0)