Skip to content

Commit f46a915

Browse files
committed
Fix bug with uninitialized shared_ptr
1 parent a58d23e commit f46a915

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstore/build/drv-output-substitution-goal.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ Goal::Co DrvOutputSubstitutionGoal::init()
3636
/* The callback of the curl download below can outlive `this` (if
3737
some other error occurs), so it must not touch `this`. So put
3838
the shared state in a separate refcounted object. */
39-
std::shared_ptr<MuxablePipe> outPipe;
39+
auto outPipe = std::make_shared<MuxablePipe>();
4040
#ifndef _WIN32
4141
outPipe->create();
4242
#else
4343
outPipe->createAsyncPipe(worker.ioport.get());
4444
#endif
4545

46-
std::shared_ptr<std::promise<std::shared_ptr<const Realisation>>> promise;
46+
auto promise = std::make_shared<std::promise<std::shared_ptr<const Realisation>>>();
4747

4848
sub->queryRealisation(
4949
id,

0 commit comments

Comments
 (0)