Parent: f6241a10e460ab14fa3e2b943460673df0ded603
Author: Bastien Nocera <hadess@hadess.net>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2024-05-17 17:41:19
Tree: b844fc2a2727f6581042c936a64e5f3ba3959d6f
obexd: Fix memory leak To not leak "buf", we need object->buffer to take ownership of it using g_string_new_take() (but it's only available in 2.78 and newer), or we need to actually free "buf". Error: RESOURCE_LEAK (CWE-772): [#def66] [important] obexd/plugins/filesystem.c:411:3: alloc_arg: "g_file_get_contents" allocates memory that is stored into "buf". obexd/plugins/filesystem.c:418:3: noescape: Resource "buf" is not freed or pointed-to in "g_string_new". obexd/plugins/filesystem.c:440:2: leaked_storage: Variable "buf" going out of scope leaks the storage it points to. 438| *err = 0; 439| 440|-> return object; 441| 442| fail:
Diffstat
| M | obexd/plugins/filesystem.c | | | 1 | + |
1 files changed, 1 insertions(+), 0 deletions(-)