t/memlock: Free allocated memory
authorBart Van Assche <bvanassche@acm.org>
Sat, 4 Jan 2020 22:07:54 +0000 (14:07 -0800)
committerBart Van Assche <bvanassche@acm.org>
Sat, 4 Jan 2020 22:39:41 +0000 (14:39 -0800)
This patch fixes the following Coverity complaint:

CID 280679:  Resource leaks  (RESOURCE_LEAK)
Variable "buf" going out of scope leaks the storage it points to.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
t/memlock.c

index 3d3579ad25292f0369b16f8a71306e9db7a8eea2..ebedb91d4eb67417563fd4e969e52d6b9bf3feec 100644 (file)
@@ -26,6 +26,7 @@ static void *worker(void *data)
                        first = 0;
                }
        }
+       free(buf);
        return NULL;
 }