summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-09-02 14:33:34 +0200
committerThomas Haller <thaller@redhat.com>2018-09-04 07:49:55 +0200
commitfd6acf61830d6d11ad86b9775136a88b4506756a (patch)
tree3a12ee69452388d7ce7e99d1da73d0a9a16959e7
parentca231f6c8ec2cfa5c3ee7f2dcc32063e554fd25d (diff)
downloadNetworkManager-fd6acf61830d6d11ad86b9775136a88b4506756a.tar.gz
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)
-rw-r--r--libnm-core/nm-keyfile-reader.c2
1 files changed, 1 insertions, 1 deletions
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++) {