netcf/Fix-memory-leak-in-aug-match-mac.patch
2020-01-11 22:24:34 +08:00

26 lines
633 B
Diff

From 478da0f8f31252be2e9e96430a8e56d9b28642ed Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@laine.org>
Date: Sep 18 2018 18:30:02 +0000
Subject: Fix memory leak in aug_match_mac()
mac_lower has memory allocated to it, but it was only freed in case of
an error.
Signed-off-by: Laine Stump <laine@laine.org>
---
diff --git a/src/dutil_linux.c b/src/dutil_linux.c
index 742153a..80c08f7 100644
--- a/src/dutil_linux.c
+++ b/src/dutil_linux.c
@@ -423,6 +423,7 @@ int aug_match_mac(struct netcf *ncf, const char *mac, char ***matches) {
(*matches)[i] = n;
}
+ FREE(mac_lower);
return nmatches;
error: