input/CdioParanoia: use AtScopeExit() for cdio_free_device_list()
This commit is contained in:
parent
be0360d5e8
commit
915c5442d1
@ -30,6 +30,7 @@
|
|||||||
#include "util/RuntimeError.hxx"
|
#include "util/RuntimeError.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
#include "util/ByteOrder.hxx"
|
#include "util/ByteOrder.hxx"
|
||||||
|
#include "util/ScopeExit.hxx"
|
||||||
#include "fs/AllocatedPath.hxx"
|
#include "fs/AllocatedPath.hxx"
|
||||||
#include "Log.hxx"
|
#include "Log.hxx"
|
||||||
#include "config/Block.hxx"
|
#include "config/Block.hxx"
|
||||||
@ -173,9 +174,9 @@ cdio_detect_device()
|
|||||||
if (devices == nullptr)
|
if (devices == nullptr)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
AllocatedPath path = AllocatedPath::FromFS(devices[0]);
|
AtScopeExit(devices) { cdio_free_device_list(devices); };
|
||||||
cdio_free_device_list(devices);
|
|
||||||
return path;
|
return AllocatedPath::FromFS(devices[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static InputStreamPtr
|
static InputStreamPtr
|
||||||
|
Loading…
Reference in New Issue
Block a user