diff options
author | smitsohu <smitsohu@gmail.com> | 2018-08-22 12:17:39 +0200 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2018-08-22 12:17:39 +0200 |
commit | 1da58e654155369b5bdd5ae1c7b33d0cc4c804b7 (patch) | |
tree | 2f9ea21b141ddf6841e40c4b3b4dc6f9dd85f035 /src | |
parent | drop privs when permissions are changed in /run/user/$UID (diff) | |
download | firejail-1da58e654155369b5bdd5ae1c7b33d0cc4c804b7.tar.gz firejail-1da58e654155369b5bdd5ae1c7b33d0cc4c804b7.tar.zst firejail-1da58e654155369b5bdd5ae1c7b33d0cc4c804b7.zip |
close private-cache memleak
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/fs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/firejail/fs.c b/src/firejail/fs.c index 8db14d502..7b138eada 100644 --- a/src/firejail/fs.c +++ b/src/firejail/fs.c | |||
@@ -1382,14 +1382,17 @@ void fs_private_cache(void) { | |||
1382 | struct stat s; | 1382 | struct stat s; |
1383 | if (is_link(cache)) { | 1383 | if (is_link(cache)) { |
1384 | fwarning("user .cache is a symbolic link, tmpfs not mounted\n"); | 1384 | fwarning("user .cache is a symbolic link, tmpfs not mounted\n"); |
1385 | free(cache); | ||
1385 | return; | 1386 | return; |
1386 | } | 1387 | } |
1387 | if (stat(cache, &s) == -1 || !S_ISDIR(s.st_mode)) { | 1388 | if (stat(cache, &s) == -1 || !S_ISDIR(s.st_mode)) { |
1388 | fwarning("no user .cache directory found, tmpfs not mounted\n"); | 1389 | fwarning("no user .cache directory found, tmpfs not mounted\n"); |
1390 | free(cache); | ||
1389 | return; | 1391 | return; |
1390 | } | 1392 | } |
1391 | if (s.st_uid != getuid()) { | 1393 | if (s.st_uid != getuid()) { |
1392 | fwarning("user .cache is not owned by current user, tmpfs not mounted\n"); | 1394 | fwarning("user .cache is not owned by current user, tmpfs not mounted\n"); |
1395 | free(cache); | ||
1393 | return; | 1396 | return; |
1394 | } | 1397 | } |
1395 | 1398 | ||