From e312313f770c61f25d182cd4e3aeacee1400f316 Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Sat, 18 Jul 2026 16:55:15 -0400 Subject: [PATCH] fix(vectornav): free temporary buffer in libvnc VnSearcher_discardData The swap buffer in VnSearcher_discardData was malloc'd but never freed, leaking on every call. Reported by Martin Strunz. No VnSearcher_* symbol is referenced by the driver today, so the linker drops searcher.c entirely and no shipped firmware is affected. Fixed anyway so the leak cannot go live if the port autodetect API is ever used. Upstream vnproglib is frozen with no public repository, so the fix is carried in the vendored copy. Signed-off-by: Ramon Roche --- src/drivers/ins/vectornav/libvnc/src/vn/sensors/searcher.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/drivers/ins/vectornav/libvnc/src/vn/sensors/searcher.c b/src/drivers/ins/vectornav/libvnc/src/vn/sensors/searcher.c index 3cdfec60569..b37b4fc3d03 100644 --- a/src/drivers/ins/vectornav/libvnc/src/vn/sensors/searcher.c +++ b/src/drivers/ins/vectornav/libvnc/src/vn/sensors/searcher.c @@ -84,6 +84,7 @@ void VnSearcher_discardData(char inputData[], size_t dataLength, size_t discardL memset(inputData, 0, dataLength); /*memcpy_s(inputData, tmpSize, tmp, tmpSize);*/ memcpy(inputData, tmp, tmpSize); + free(tmp); } }