aboutsummaryrefslogtreecommitdiffstats
path: root/src/fseccomp/syscall.c
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2019-02-06 16:13:28 +0100
committerLibravatar smitsohu <smitsohu@gmail.com>2019-02-06 16:13:28 +0100
commitf77127f5b10f3b19c4c152b49018b24ff4d3590a (patch)
treee43681df9f06fdaac233265034cd30a70a375f40 /src/fseccomp/syscall.c
parentstrncmp byte count fixes (diff)
parentfix small memleak (diff)
downloadfirejail-f77127f5b10f3b19c4c152b49018b24ff4d3590a.tar.gz
firejail-f77127f5b10f3b19c4c152b49018b24ff4d3590a.tar.zst
firejail-f77127f5b10f3b19c4c152b49018b24ff4d3590a.zip
Merge branch 'master' of https://github.com/netblue30/firejail
Diffstat (limited to 'src/fseccomp/syscall.c')
-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;