diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-09-11 21:02:19 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-09-14 15:22:18 +0200 |
commit | 830a1b8c9e9a26dc1101167ac66a75c444902c4d (patch) | |
tree | c8846c6a98eb81e95d0b4459b146d8075b7f0913 /methods/https.h | |
parent | ae732225ec2fa0d7434c9f40a92ced8683752211 (diff) |
fix two memory leaks reported by gcc
Reported-By: gcc -fsanitize=address -fno-sanitize=vptr
Git-Dch: Ignore
Diffstat (limited to 'methods/https.h')
-rw-r--r-- | methods/https.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/methods/https.h b/methods/https.h index 29b20b921..167107ad6 100644 --- a/methods/https.h +++ b/methods/https.h @@ -17,6 +17,7 @@ #include <iostream> #include <stddef.h> #include <string> +#include <memory> #include "server.h" @@ -67,7 +68,7 @@ class HttpsMethod : public ServerMethod double ultotal, double ulnow); void SetupProxy(); CURL *curl; - ServerState *Server; + std::unique_ptr<ServerState> Server; // Used by ServerMethods unused by https virtual void SendReq(FetchItem *) APT_OVERRIDE { exit(42); } @@ -77,7 +78,7 @@ class HttpsMethod : public ServerMethod FileFd *File; virtual bool Configuration(std::string Message) APT_OVERRIDE; - virtual ServerState * CreateServerState(URI uri) APT_OVERRIDE; + virtual std::unique_ptr<ServerState> CreateServerState(URI const &uri) APT_OVERRIDE; using pkgAcqMethod::FetchResult; using pkgAcqMethod::FetchItem; |