summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-06-06 18:20:35 +0200
committerMichael Vogt <mvo@debian.org>2013-06-06 18:20:35 +0200
commit245ba2c306e663fb311b7796fdf13a7ae7073a4d (patch)
treeb80b7c51d94908186c9d9a333be390e08297f567 /methods
parente3b402f40373365e169f30d276e467f708074ffc (diff)
Fix double free (closes: #711045)
* Fix double free (closes: #711045) * Fix crash when the "mirror" method does not find any entry (closes: #699303)
Diffstat (limited to 'methods')
-rw-r--r--methods/mirror.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/methods/mirror.cc b/methods/mirror.cc
index d6c5ba955..854366318 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -311,6 +311,9 @@ bool MirrorMethod::InitMirrors()
AllMirrors.push_back(s);
}
+ if (AllMirrors.empty()) {
+ return _error->Error(_("No entry found in mirror file '%s'"), MirrorFile.c_str());
+ }
Mirror = AllMirrors[0];
UsedMirror = Mirror;
return true;