freebsd-ports/audio/wavpack/files/patch-fix-memory-leaks
Thomas Zander 29d1ea59d5 Fix multiple CVEs and memory leaks
Details:
- Import patches from upstream HEAD to address
  a bunch of critical CVEs including potential remote
  code execution and memory leaks

PR:		228141
Submitted by:	yasu@utahime.org
MFH:		2018Q2
Security:	CVE-2018-6767
		CVE-2018-7253
		CVE-2018-7254
		CVE-2018-10536
		CVE-2018-10537
		CVE-2018-10538
		CVE-2018-10539
		CVE-2018-10540
2018-05-13 07:50:13 +00:00

36 lines
887 B
Text

From 0a72951de8feaaf4c6e1740b5cb5cd0401b00464 Mon Sep 17 00:00:00 2001
From: David Bryant <david@wavpack.com>
Date: Sun, 8 Apr 2018 16:27:40 -0700
Subject: [PATCH 4/6] fix memory leaks
---
src/common_utils.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git src/common_utils.c src/common_utils.c
index c53db91..f8ddc63 100644
--- src/common_utils.c
+++ src/common_utils.c
@@ -384,6 +384,19 @@ WavpackContext *WavpackCloseFile (WavpackContext *wpc)
WavpackFreeWrapper (wpc);
+ if (wpc->metadata) {
+ int i;
+
+ for (i = 0; i < wpc->metacount; ++i)
+ if (wpc->metadata [i].data)
+ free (wpc->metadata [i].data);
+
+ free (wpc->metadata);
+ }
+
+ if (wpc->channel_identities)
+ free (wpc->channel_identities);
+
if (wpc->channel_reordering)
free (wpc->channel_reordering);
--
2.17.0