8000 Merge pull request #120 from kolyshkin/nits · seccomp/libseccomp-golang@219c314 · GitHub
[go: up one dir, main page]

Skip to content

Commit 219c314

Browse files
authored
Merge pull request #120 from kolyshkin/nits
Minor assorted fixes Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Acked-by: Tom Hromatka <tom.hromatka@oracle.com>
2 parents 5143533 + 404de4b commit 219c314

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

seccomp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ func (f *ScmpFilter) TransactionReject() {
13431343
C.seccomp_transaction_reject(f.filterCtx)
13441344
}
13451345

1346-
// TransactionReject commits a transaction started by [TransactionStart].
1346+
// TransactionCommit commits a transaction started by [TransactionStart].
13471347
func (f *ScmpFilter) TransactionCommit() error {
13481348
f.lock.Lock()
13491349
defer f.lock.Unlock()

seccomp_internal.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -818,10 +818,7 @@ func notifReceive(fd ScmpFd) (*ScmpNotifReq, error) {
818818
if retCode := C.seccomp_notify_alloc(&req, &resp); retCode != 0 {
819819
return nil, errRc(retCode)
820820
}
821-
822-
defer func() {
823-
C.seccomp_notify_free(req, resp)
824-
}()
821+
defer C.seccomp_notify_free(req, resp)
825822

826823
for {
827824
retCode, errno := C.seccomp_notify_receive(C.int(fd), req)
@@ -855,10 +852,7 @@ func notifRespond(fd ScmpFd, scmpResp *ScmpNotifResp) error {
855852
if retCode := C.seccomp_notify_alloc(&req, &resp); retCode != 0 {
856853
return errRc(retCode)
857854
}
858-
859-
defer func() {
860-
C.seccomp_notify_free(req, resp)
861-
}()
855+
defer C.seccomp_notify_free(req, resp)
862856

863857
scmpResp.toNative(resp)
864858

0 commit comments

Comments
 (0)
0