summaryrefslogtreecommitdiffstats
path: root/src/fseccomp
diff options
context:
space:
mode:
authorLibravatar Reiner Herrmann <reiner@reiner-h.de>2019-02-05 22:24:35 +0100
committerLibravatar Reiner Herrmann <reiner@reiner-h.de>2019-02-05 22:24:35 +0100
commit040c81a61187af6fe3e2f92a38d019a699971a01 (patch)
tree2eeac82b9bb70aa8ce05c04e6ab0f006dbb09702 /src/fseccomp
parentvariable only used when whitelisting enabled (diff)
downloadfirejail-040c81a61187af6fe3e2f92a38d019a699971a01.tar.gz
firejail-040c81a61187af6fe3e2f92a38d019a699971a01.tar.zst
firejail-040c81a61187af6fe3e2f92a38d019a699971a01.zip
fix small memleak
Diffstat (limited to 'src/fseccomp')
-rw-r--r--src/fseccomp/syscall.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fseccomp/syscall.c b/src/fseccomp/syscall.c
index 3f5fbbbfa..7ea1e749d 100644
--- a/src/fseccomp/syscall.c
+++ b/src/fseccomp/syscall.c
@@ -546,7 +546,7 @@ static void syscall_in_list(int fd, int syscall, int arg, void *ptrarg) {
546 } 546 }
547 else { // no problem, add to pre-exec list 547 else { // no problem, add to pre-exec list
548 // build syscall:error_no 548 // build syscall:error_no
549 char *newcall; 549 char *newcall = NULL;
550 if (arg != 0) { 550 if (arg != 0) {
551 if (asprintf(&newcall, "%s:%s", syscall_find_nr(syscall), errno_find_nr(arg)) == -1) 551 if (asprintf(&newcall, "%s:%s", syscall_find_nr(syscall), errno_find_nr(arg)) == -1)
552 errExit("asprintf"); 552 errExit("asprintf");
@@ -560,6 +560,7 @@ static void syscall_in_list(int fd, int syscall, int arg, void *ptrarg) {
560 if (ptr->prelist) { 560 if (ptr->prelist) {
561 if (asprintf(&ptr->prelist, "%s,%s", ptr->prelist, newcall) == -1) 561 if (asprintf(&ptr->prelist, "%s,%s", ptr->prelist, newcall) == -1)
562 errExit("asprintf"); 562 errExit("asprintf");
563 free(newcall);
563 } 564 }
564 else 565 else
565 ptr->prelist = newcall; 566 ptr->prelist = newcall;