summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-04-10 10:23:14 +0200
committerAndreas Schneider <asn@samba.org>2014-04-14 15:28:46 +0200
commit03726df0861c1a4f85e938a77616ac8780aa4760 (patch)
treebfbd2b3d8c76e39c7e845cb865f8f12468ccda07
parent2fb245848b786cd8a3d776810f1faf27d8819097 (diff)
downloadsocket_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.c5
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) {