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 9272c2402..c26e4e07c 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -459,13 +459,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)