summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 59b1fd3c4..ed0ddf7ac 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -417,13 +417,16 @@ pkgAcquire::MethodConfig *pkgAcquire::GetConfig(string Access)
// Create the new config class
Conf = new MethodConfig;
Conf->Access = Access;
- Conf->Next = Configs;
- Configs = Conf;
// Create the worker to fetch the configuration
Worker Work(Conf);
if (Work.Start() == false)
- return 0;
+ {
+ delete Conf;
+ return nullptr;
+ }
+ Conf->Next = Configs;
+ Configs = Conf;
/* if a method uses DownloadLimit, we switch to SingleInstance mode */
if(_config->FindI("Acquire::"+Access+"::Dl-Limit",0) > 0)