From 3ac8dcc3de34b15211e56093bdccb48e46956d53 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowalski Date: Tue, 18 Jun 2024 11:24:24 +0200 Subject: [PATCH] caget: free memory allocated for PV array --- modules/ca/src/tools/caget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ca/src/tools/caget.c b/modules/ca/src/tools/caget.c index d24fcd066..6366a8d2c 100644 --- a/modules/ca/src/tools/caget.c +++ b/modules/ca/src/tools/caget.c @@ -388,7 +388,7 @@ int main (int argc, char *argv[]) int digits = 0; /* getopt() no. of float digits */ int nPvs; /* Number of PVs */ - pv* pvs; /* Array of PV structures */ + pv* pvs = NULL; /* Array of PV structures */ LINE_BUFFER(stdout); /* Configure stdout buffering */ @@ -556,6 +556,7 @@ int main (int argc, char *argv[]) result = caget(pvs, nPvs, request, format, type, count); /* Shut down Channel Access */ + free(pvs); ca_context_destroy(); return result;