From fd6acf61830d6d11ad86b9775136a88b4506756a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 2 Sep 2018 14:33:34 +0200 Subject: [PATCH] libnm/keyfile: fix double free in keyfile's get_bytes() Fixes: 5e7b14af03fef98566367c211c0e7f75ad9a9525 (cherry picked from commit fcf254c03a7c2a37ae1138240f756760f217ca6f) (cherry picked from commit 1c56be409064ee6919246970bd4457df3a846beb) (cherry picked from commit 71e2a25a0d67399c8c2a5f3ddb3fc7a2a1f50067) --- libnm-core/nm-keyfile-reader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnm-core/nm-keyfile-reader.c b/libnm-core/nm-keyfile-reader.c index 0ac417cdb4..12a8066054 100644 --- a/libnm-core/nm-keyfile-reader.c +++ b/libnm-core/nm-keyfile-reader.c @@ -821,7 +821,7 @@ get_bytes (KeyfileReaderInfo *info, * byte-array. The reason is that zero_terminate is there to terminate * *valid* strings. It's not there to terminated invalid (empty) strings. */ - return g_bytes_new_take (tmp_string, 0); + return g_bytes_new_static ("", 0); } for (length = 0; tmp_string[length]; length++) {