ping_pong: Fix CID 1273087 Resource leak
authorVolker Lendecke <vl@samba.org>
Sun, 3 May 2015 09:34:41 +0000 (09:34 +0000)
committerMartin Schwenke <martin@meltin.net>
Wed, 24 Feb 2016 10:44:27 +0000 (21:44 +1100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
(Imported from commit bfbaf51cd627b2d1052dd23be4b0df5e004cc92f)

utils/ping_pong/ping_pong.c

index 1d134a1462cf6e5a82da34bece73e0d600a7a74b..fdb575daae29c305c12d978024e01b32580f53bc 100644 (file)
@@ -141,6 +141,7 @@ 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);
                return;
        }