git.samba.org
/
gd
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aff33a5
)
ctdb-utils: Fix CID 1297451 Explicit null dereferenced (FORWARD_NULL)
author
Martin Schwenke
<martin@meltin.net>
Wed, 27 Jul 2016 07:43:34 +0000
(17:43 +1000)
committer
Amitay Isaacs
<amitay@samba.org>
Wed, 3 Aug 2016 03:29:23 +0000
(
05:29
+0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/utils/ping_pong/ping_pong.c
patch
|
blob
|
history
diff --git
a/ctdb/utils/ping_pong/ping_pong.c
b/ctdb/utils/ping_pong/ping_pong.c
index be43a1d704d24c3043cf4a402bb3a16899275293..f7f2eb1ed164ab39d21e61cd87767ad6feead5c9 100644
(file)
--- 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;
}