aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Reiner Herrmann <reiner@reiner-h.de>2016-02-13 16:43:08 +0100
committerLibravatar Reiner Herrmann <reiner@reiner-h.de>2016-02-13 16:47:24 +0100
commit06156913c40a4c2eccb15ab81f1ee78f87a68792 (patch)
treeee3739121f85c0628b86334e3429fc6247c9b97c
parentremove konsole blacklist (diff)
downloadfirejail-06156913c40a4c2eccb15ab81f1ee78f87a68792.tar.gz
firejail-06156913c40a4c2eccb15ab81f1ee78f87a68792.tar.zst
firejail-06156913c40a4c2eccb15ab81f1ee78f87a68792.zip
Fix memory leak
-rw-r--r--src/firejail/main.c10
-rw-r--r--src/firejail/profile.c2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c
index 2f64d2268..4882e29e6 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -1598,6 +1598,16 @@ int main(int argc, char **argv) {
1598 free(cfg.seccomp_list_errno); 1598 free(cfg.seccomp_list_errno);
1599 } 1599 }
1600#endif 1600#endif
1601 if (cfg.profile) {
1602 ProfileEntry *prf = cfg.profile;
1603 while (prf != NULL) {
1604 ProfileEntry *next = prf->next;
1605 free(prf->data);
1606 free(prf->link);
1607 free(prf);
1608 prf = next;
1609 }
1610 }
1601 1611
1602 myexit(0); 1612 myexit(0);
1603 1613
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index e0de69e5e..5acbbec38 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -533,6 +533,8 @@ void profile_read(const char *fname) {
533 // verify syntax, exit in case of error 533 // verify syntax, exit in case of error
534 if (profile_check_line(ptr, lineno, fname)) 534 if (profile_check_line(ptr, lineno, fname))
535 profile_add(ptr); 535 profile_add(ptr);
536 else
537 free(ptr);
536 } 538 }
537 fclose(fp); 539 fclose(fp);
538} 540}