1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

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>
This commit is contained in:
Martin Schwenke 2016-07-27 17:43:34 +10:00 committed by Amitay Isaacs
parent aff33a5947
commit d46960f20e

View File

@ -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;
}