diff mbox series

[4/4] technology: Fix memory leak.

Message ID 3aea58eb-e3ea-4abd-b6ab-b03e0bfd7f19@gmx.de (mailing list archive)
State Accepted, archived
Headers show
Series Fixes for memory leaks and corruptions | expand

Commit Message

Robert Tiemann Feb. 13, 2024, 1:18 p.m. UTC
---
 src/technology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
2.34.1
diff mbox series

Patch

diff --git a/src/technology.c b/src/technology.c
index 65fb9854..270d83d0 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -479,8 +479,10 @@  static void technology_load(struct connman_technology *technology)

 	enc = g_key_file_get_string(keyfile,
 				identifier, "Tethering.Passphrase", NULL);
-	if (enc)
+	if (enc) {
 		technology->tethering_passphrase = g_strcompress(enc);
+		g_free(enc);
+	}

 	technology->tethering_freq = g_key_file_get_integer(keyfile,
 				identifier, "Tethering.Freq", NULL);