From e13271a35ebe1580929c3a5de3169501b5d81634 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 17 Jan 2008 21:50:20 +0100 Subject: [PATCH] vcc.c: Fix a memory leak in recv_afs_result(). This function contained a code path that allocated the buffer for the chunk table and then returned an error (due to a failing fstat()) without freeing the chunk table buffer. --- vss.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vss.c b/vss.c index 89e06c92..8ba17fc3 100644 --- a/vss.c +++ b/vss.c @@ -383,6 +383,7 @@ static void recv_afs_result(void) struct stat statbuf; struct timeval now; + mmd->afd.afhi.chunk_table = NULL; ret = recv_afs_msg(&passed_fd, &afs_code, &afs_data); if (ret < 0) goto err; @@ -419,6 +420,7 @@ static void recv_afs_result(void) tv_add(&now, &announce_tv, &data_send_barrier); return; err: + free(mmd->afd.afhi.chunk_table); if (passed_fd >= 0) close(passed_fd); PARA_ERROR_LOG("%s\n", para_strerror(-ret)); -- 2.39.5