diff options
author | Andreas Schneider <asn@samba.org> | 2014-04-10 10:23:14 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2014-04-14 15:28:46 +0200 |
commit | 03726df0861c1a4f85e938a77616ac8780aa4760 (patch) | |
tree | bfbd2b3d8c76e39c7e845cb865f8f12468ccda07 | |
parent | 2fb245848b786cd8a3d776810f1faf27d8819097 (diff) | |
download | socket_wrapper-03726df0861c1a4f85e938a77616ac8780aa4760.tar.gz socket_wrapper-03726df0861c1a4f85e938a77616ac8780aa4760.tar.xz socket_wrapper-03726df0861c1a4f85e938a77616ac8780aa4760.zip |
tests: Fix creating remove_cmd.
Found by Coverity.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
-rw-r--r-- | tests/test_ioctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_ioctl.c b/tests/test_ioctl.c index 86734cf..077e553 100644 --- a/tests/test_ioctl.c +++ b/tests/test_ioctl.c @@ -37,9 +37,10 @@ static void teardown(void **state) (void) state; /* unused */ - if (swrap_dir != NULL) { - snprintf(remove_cmd, sizeof(remove_cmd), "rm -rf %s", swrap_dir); + if (swrap_dir == NULL) { + return; } + snprintf(remove_cmd, sizeof(remove_cmd), "rm -rf %s", swrap_dir); rc = system(remove_cmd); if (rc < 0) { |