Push some ownership out a bit.
This commit is contained in:
@ -224,7 +224,7 @@ FileInfo::operator <=> ( const FileInfo &rhs ) const
|
|||||||
/*
|
/*
|
||||||
* Allocate a DilloDir structure, set safe values in it and sort the entries.
|
* Allocate a DilloDir structure, set safe values in it and sort the entries.
|
||||||
*/
|
*/
|
||||||
static DilloDir *File_dillodir_new(const std::string &dirname)
|
static std::unique_ptr< DilloDir > File_dillodir_new(const std::string &dirname)
|
||||||
{
|
{
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
@ -276,7 +276,7 @@ static DilloDir *File_dillodir_new(const std::string &dirname)
|
|||||||
std::sort( begin( Ddir->flist ), end( Ddir->flist ),
|
std::sort( begin( Ddir->flist ), end( Ddir->flist ),
|
||||||
[]( const auto &lhs, const auto &rhs ) { return *lhs < *rhs; } );
|
[]( const auto &lhs, const auto &rhs ) { return *lhs < *rhs; } );
|
||||||
|
|
||||||
return Ddir.release();
|
return Ddir;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -622,7 +622,7 @@ static int File_prepare_send_dir(ClientInfo *client,
|
|||||||
ds_dirname+= "/";
|
ds_dirname+= "/";
|
||||||
|
|
||||||
/* Let's get a structure ready for transfer */
|
/* Let's get a structure ready for transfer */
|
||||||
Ddir = File_dillodir_new(ds_dirname.c_str());
|
Ddir = File_dillodir_new(ds_dirname.c_str()).release();
|
||||||
if (Ddir) {
|
if (Ddir) {
|
||||||
/* looks ok, set things accordingly */
|
/* looks ok, set things accordingly */
|
||||||
client->orig_url = dStrdup(orig_url);
|
client->orig_url = dStrdup(orig_url);
|
||||||
|
|||||||
Reference in New Issue
Block a user