summaryrefslogtreecommitdiff
path: root/ctdb/utils
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-07-27 17:43:34 +1000
committerAmitay Isaacs <amitay@samba.org>2016-08-03 05:29:23 +0200
commitd46960f20e795cd4abc1c727705f77b2f0e0e564 (patch)
tree988880b9f7a2bd14095af56ad4796a14263d313e /ctdb/utils
parentaff33a59479cafcb1f24a07ff76383d47bb196b3 (diff)
downloadsamba-d46960f20e795cd4abc1c727705f77b2f0e0e564.tar.gz
ctdb-utils: Fix CID 1297451 Explicit null dereferenced (FORWARD_NULL)
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/utils')
-rw-r--r--ctdb/utils/ping_pong/ping_pong.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ctdb/utils/ping_pong/ping_pong.c b/ctdb/utils/ping_pong/ping_pong.c
index be43a1d704d..f7f2eb1ed16 100644
--- a/ctdb/utils/ping_pong/ping_pong.c
+++ b/ctdb/utils/ping_pong/ping_pong.c
@@ -142,7 +142,9 @@ static void ping_pong(int fd, int num_locks)
val = (unsigned char *)calloc(num_locks+1, sizeof(unsigned char));
if (val == NULL) {
printf("calloc failed\n");
- munmap(p, num_locks+1);
+ if (use_mmap) {
+ munmap(p, num_locks+1);
+ }
return;
}