]> git.saurik.com Git - apt.git/blobdiff - test/libapt/cdrom_test.cc
Division by result of sizeof(). memset() expects a size in bytes
[apt.git] / test / libapt / cdrom_test.cc
index 626ef538e5364c61d38e0e7c551693d0c3fd0be8..7257eaf1b5aabb4179641ed949cda9f3f356346b 100644 (file)
@@ -91,7 +91,7 @@ TEST(CDROMTest,ReduceSourcelist)
 }
 TEST(CDROMTest, FindMountPointForDevice)
 {
-   char * tempfile;
+   char * tempfile = NULL;
    FileFd fd;
    createTemporaryFile("mountpoints", fd, &tempfile,
         "rootfs / rootfs rw 0 0\n"
@@ -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);
 }