summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-07-27 17:43:34 +1000
committerKarolin Seeger <kseeger@samba.org>2016-08-10 09:03:25 +0200
commit6b22bee52edd1336454893d6c60e0dd004fd1a78 (patch)
tree22cb55e595ae9a2e36a9765ca484d372b3e2d3a2 /ctdb
parent0c0231d9c6edbdae707d4930967108c7eec033b6 (diff)
downloadsamba-6b22bee52edd1336454893d6c60e0dd004fd1a78.tar.gz
ctdb-utils: Fix CID 1297451 Explicit null dereferenced (FORWARD_NULL)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit d46960f20e795cd4abc1c727705f77b2f0e0e564)
Diffstat (limited to 'ctdb')
-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;
}