* [Bluez PATCH 5/6] Fix leaks in src
@ 2021-05-12 21:41 Steve Grubb
0 siblings, 0 replies; 2+ messages in thread
From: Steve Grubb @ 2021-05-12 21:41 UTC (permalink / raw)
To: linux-bluetooth
g_key_file_get_string allocates memory that must be freed.
asprintf allocates memory that must be freed.
Signed-off-by: Steve Grubb <sgrubb@redhat.com>
---
src/main.c | 1 +
src/shared/shell.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/main.c b/src/main.c
index c32bda7d4..94141b1e4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -795,6 +795,7 @@ static void parse_config(GKeyFile *config)
parse_br_config(config);
parse_le_config(config);
+ g_free(str);
}
static void init_defaults(void)
diff --git a/src/shared/shell.c b/src/shared/shell.c
index c0de1640d..eed300631 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -611,6 +611,7 @@ void bt_shell_prompt_input(const char *label, const char *msg,
prompt->user_data = user_data;
queue_push_tail(data.prompts, prompt);
+ free(str);
return;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Bluez PATCH 5/6] Fix leaks in src
@ 2021-05-14 14:00 Steve Grubb
0 siblings, 0 replies; 2+ messages in thread
From: Steve Grubb @ 2021-05-14 14:00 UTC (permalink / raw)
To: linux-bluetooth
g_key_file_get_string allocates memory that must be freed.
asprintf allocates memory that must be freed.
---
src/main.c | 1 +
src/shared/shell.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/main.c b/src/main.c
index c32bda7d4..94141b1e4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -795,6 +795,7 @@ static void parse_config(GKeyFile *config)
parse_br_config(config);
parse_le_config(config);
+ g_free(str);
}
static void init_defaults(void)
diff --git a/src/shared/shell.c b/src/shared/shell.c
index c0de1640d..eed300631 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -611,6 +611,7 @@ void bt_shell_prompt_input(const char *label, const char *msg,
prompt->user_data = user_data;
queue_push_tail(data.prompts, prompt);
+ free(str);
return;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-14 14:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 21:41 [Bluez PATCH 5/6] Fix leaks in src Steve Grubb
2021-05-14 14:00 Steve Grubb
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.