Browse Source

* apt-pkg/acquire-methods.cc:

- factor out into private Dequeue() to fix access to deleted pointer
debian/1.8.y
David Kalnischkies 10 years ago
parent
commit
e1284a59de
  1. 23
      apt-pkg/acquire-method.cc
  2. 3
      apt-pkg/acquire-method.h
  3. 2
      debian/changelog

23
apt-pkg/acquire-method.cc

@ -95,12 +95,7 @@ void pkgAcqMethod::Fail(string Err,bool Transient)
{
std::cout << "400 URI Failure\nURI: " << Queue->Uri << "\n"
<< "Message: " << Err << " " << IP << "\n";
// Dequeue
FetchItem *Tmp = Queue;
Queue = Queue->Next;
delete Tmp;
if (Tmp == QueueBack)
QueueBack = Queue;
Dequeue();
}
else
std::cout << "400 URI Failure\nURI: <UNKNOWN>\nMessage: " << Err << "\n";
@ -211,13 +206,7 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt)
}
std::cout << "\n" << std::flush;
// Dequeue
FetchItem *Tmp = Queue;
Queue = Queue->Next;
delete Tmp;
if (Tmp == QueueBack)
QueueBack = Queue;
Dequeue();
}
/*}}}*/
// AcqMethod::MediaFail - Syncronous request for new media /*{{{*/
@ -465,3 +454,11 @@ void pkgAcqMethod::FetchResult::TakeHashes(Hashes &Hash)
SHA512Sum = Hash.SHA512.Result();
}
/*}}}*/
void pkgAcqMethod::Dequeue() { /*{{{*/
FetchItem const * const Tmp = Queue;
Queue = Queue->Next;
if (Tmp == QueueBack)
QueueBack = Queue;
delete Tmp;
}
/*}}}*/

3
apt-pkg/acquire-method.h

@ -104,6 +104,9 @@ class pkgAcqMethod
pkgAcqMethod(const char *Ver,unsigned long Flags = 0);
virtual ~pkgAcqMethod() {};
private:
void Dequeue();
};
/** @} */

2
debian/changelog

@ -15,6 +15,8 @@ apt (0.9.4) UNRELEASED; urgency=low
* debian/control:
- move doxygen and debiandoc-sgml to Build-Depends-Indep as docs
are no longer build in the same target as the manpages
* apt-pkg/acquire-methods.cc:
- factor out into private Dequeue() to fix access to deleted pointer
-- David Kalnischkies <kalnischkies@gmail.com> Fri, 11 May 2012 23:26:59 +0200

Loading…
Cancel
Save