diff options
author | 2024-06-05 20:16:01 +0300 | |
---|---|---|
committer | 2024-06-05 17:16:01 +0000 | |
commit | 03ea436e1cb35fdcba8fb6588de209d0a10174e9 (patch) | |
tree | 170711d3f7db2c7a6ca92213dc56aa33f26465fb /src/firecfg | |
parent | build(deps): bump step-security/harden-runner from 2.7.1 to 2.8.0 (diff) | |
download | firejail-03ea436e1cb35fdcba8fb6588de209d0a10174e9.tar.gz firejail-03ea436e1cb35fdcba8fb6588de209d0a10174e9.tar.zst firejail-03ea436e1cb35fdcba8fb6588de209d0a10174e9.zip |
bugfix: fix various resource leaks (#6367)
Fix memory and descriptor leaks.
Signed-off-by: Ilya Pankratov <i.pankratov.main@gmail.com>
Diffstat (limited to 'src/firecfg')
-rw-r--r-- | src/firecfg/desktop_files.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/firecfg/desktop_files.c b/src/firecfg/desktop_files.c index 1895e437b..8c21757ab 100644 --- a/src/firecfg/desktop_files.c +++ b/src/firecfg/desktop_files.c | |||
@@ -300,6 +300,7 @@ void fix_desktop_files(const char *homedir) { | |||
300 | 300 | ||
301 | if (stat(outname, &sb) == 0) { | 301 | if (stat(outname, &sb) == 0) { |
302 | printf(" %s skipped: file exists\n", filename); | 302 | printf(" %s skipped: file exists\n", filename); |
303 | free(outname); | ||
303 | if (change_exec) | 304 | if (change_exec) |
304 | free(change_exec); | 305 | free(change_exec); |
305 | continue; | 306 | continue; |
@@ -308,6 +309,7 @@ void fix_desktop_files(const char *homedir) { | |||
308 | FILE *fpin = fopen(filename, "r"); | 309 | FILE *fpin = fopen(filename, "r"); |
309 | if (!fpin) { | 310 | if (!fpin) { |
310 | fprintf(stderr, "Warning: cannot open /usr/share/applications/%s\n", filename); | 311 | fprintf(stderr, "Warning: cannot open /usr/share/applications/%s\n", filename); |
312 | free(outname); | ||
311 | if (change_exec) | 313 | if (change_exec) |
312 | free(change_exec); | 314 | free(change_exec); |
313 | continue; | 315 | continue; |
@@ -317,6 +319,7 @@ void fix_desktop_files(const char *homedir) { | |||
317 | if (!fpout) { | 319 | if (!fpout) { |
318 | fprintf(stderr, "Warning: cannot open ~/.local/share/applications/%s\n", outname); | 320 | fprintf(stderr, "Warning: cannot open ~/.local/share/applications/%s\n", outname); |
319 | fclose(fpin); | 321 | fclose(fpin); |
322 | free(outname); | ||
320 | if (change_exec) | 323 | if (change_exec) |
321 | free(change_exec); | 324 | free(change_exec); |
322 | continue; | 325 | continue; |