diff options
Diffstat (limited to 'test/libapt')
-rw-r--r-- | test/libapt/cdrom_test.cc | 3 | ||||
-rw-r--r-- | test/libapt/sourcelist_test.cc | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/test/libapt/cdrom_test.cc b/test/libapt/cdrom_test.cc index 5cf3b353c..7257eaf1b 100644 --- a/test/libapt/cdrom_test.cc +++ b/test/libapt/cdrom_test.cc @@ -109,6 +109,7 @@ TEST(CDROMTest, FindMountPointForDevice) EXPECT_EQ("/boot/efi", FindMountPointForDevice("/dev/sda1")); EXPECT_EQ("/tmp", FindMountPointForDevice("tmpfs")); - unlink(tempfile); + if (tempfile != NULL) + unlink(tempfile); free(tempfile); } diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index eb2d76c43..747ab4957 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -20,7 +20,7 @@ class SourceList : public pkgSourceList { TEST(SourceListTest,ParseFileDeb822) { FileFd fd; - char * tempfile; + char * tempfile = NULL; createTemporaryFile("parsefiledeb822", fd, &tempfile, "Types: deb\n" "URIs: http://ftp.debian.org/debian\n" |