about summary refs log tree commit diff
path: root/libnm-util/crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-util/crypto.c')
-rw-r--r--libnm-util/crypto.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libnm-util/crypto.c b/libnm-util/crypto.c
index 949ee812..0cad7f60 100644
--- a/libnm-util/crypto.c
+++ b/libnm-util/crypto.c
@@ -238,19 +238,25 @@ parse_old_openssl_key_file (const GByteArray *contents,
 		             _("Could not decode private key."));
 		goto parse_error;
 	}
+	g_string_free (str, TRUE);
 
 	if (lines)
 		g_strfreev (lines);
 
 	bindata = g_byte_array_sized_new (tmp_len);
 	g_byte_array_append (bindata, tmp, tmp_len);
+	g_free (tmp);
+
 	*out_iv = iv;
 	*out_cipher = cipher;
 	return bindata;
 
 parse_error:
+	g_free (tmp);
 	g_free (cipher);
 	g_free (iv);
+	if (str)
+		g_string_free (str, TRUE);
 	if (lines)
 		g_strfreev (lines);
 	return NULL;