summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-06-18 17:33:15 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-08-10 17:25:25 +0200
commit3d8232bf97ce11818fb07813a71136484ea1a44a (patch)
treec7e1e3885e952f7ab8171e1cf4b425ddccb5606f /apt-pkg/contrib
parentc3392a9fccc04129816057b1184c651171034376 (diff)
fix memory leaks reported by -fsanitize
Various small leaks here and there. Nothing particularily big, but still good to fix. Found by the sanitizers while running our testcases. Reported-By: gcc -fsanitize Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/cdromutl.cc2
-rw-r--r--apt-pkg/contrib/gpgv.cc2
2 files changed, 4 insertions, 0 deletions
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc
index 6eb917457..428ef0161 100644
--- a/apt-pkg/contrib/cdromutl.cc
+++ b/apt-pkg/contrib/cdromutl.cc
@@ -287,9 +287,11 @@ string FindMountPointForDevice(const char *devnode)
fclose(f);
// unescape the \0XXX chars in the path
string mount_point = out[1];
+ free(line);
return DeEscapeString(mount_point);
}
fclose(f);
+ free(line);
}
return string();
diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc
index 9d798cca9..a01e319eb 100644
--- a/apt-pkg/contrib/gpgv.cc
+++ b/apt-pkg/contrib/gpgv.cc
@@ -296,6 +296,8 @@ bool SplitClearSignedFile(std::string const &InFile, FileFd * const ContentFile,
// all the rest is whitespace, unsigned garbage or additional message blocks we ignore
}
fclose(in);
+ if (buf != NULL)
+ free(buf);
if (found_signature == true)
return _error->Error("Signature in file %s wasn't closed", InFile.c_str());