diff options
author | Paul Moore <pmoore@redhat.com> | 2014-04-23 18:34:49 -0400 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2014-05-01 14:15:49 -0400 |
commit | 42badbc70fc93b622b9aa2dba74f434d0334a870 (patch) | |
tree | 50886e643d3da9a73b67939d9a61845f2d5fbd45 /tests/17-sim-arch_merge.c | |
parent | 0fa292323f4b214a0c2f17206f183719fe382215 (diff) | |
download | libseccomp-42badbc70fc93b622b9aa2dba74f434d0334a870.tar.gz |
tests: correctly return an error if seccomp_init() fails
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'tests/17-sim-arch_merge.c')
-rw-r--r-- | tests/17-sim-arch_merge.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/17-sim-arch_merge.c b/tests/17-sim-arch_merge.c index cb0e33c..58af194 100644 --- a/tests/17-sim-arch_merge.c +++ b/tests/17-sim-arch_merge.c @@ -19,8 +19,8 @@ * along with this library; if not, see <http://www.gnu.org/licenses>. */ -#include <unistd.h> #include <errno.h> +#include <unistd.h> #include <seccomp.h> @@ -37,11 +37,15 @@ int main(int argc, char *argv[]) goto out_all; ctx_32 = seccomp_init(SCMP_ACT_KILL); - if (ctx_32 == NULL) + if (ctx_32 == NULL) { + rc = -ENOMEM; goto out_all; + } ctx_64 = seccomp_init(SCMP_ACT_KILL); - if (ctx_64 == NULL) + if (ctx_64 == NULL) { + rc = -ENOMEM; goto out_all; + } rc = seccomp_arch_remove(ctx_32, SCMP_ARCH_NATIVE); if (rc != 0) |