Commit: b4e74f7bd0ca1f8c251077367a9b040c4a651617
Parent: 24d986e72d4bb7e412b8dd42a54b99ad24a1f2dd
Author: Tedd Ho-Jeong An <tedd.an@intel.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2022-02-12 00:17:27
Tree: 6cf7e77f4c4c1208929c210fe2f5bd13e002b8cc

adapter: Fix the reusing gerror without re-initialization When the GError variable is freeed with g_error_free(), it is not set to NULL and reusing the same variable again can cause the seg_fault because it is still pointing the old memory address which is freed. This patch relaces the g_error_free() to g_clear_error() which frees the variable and set it to NULL if the variable is used in the function again. Fixes: 2287c517ca1bd ("adapter: Fix unchecked return value") Fixes: https://github.com/bluez/bluez/issues/276

Diffstat

M src/adapter.c | 34 +++++++++++++++++- - - - - - - - - - - - - - - - -

1 files changed, 17 insertions(+), 17 deletions(-)

View Full Diff | Patch