If bt_uuid2string() returns NULL then svcclass has to be freed
---
src/storage.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/storage.c b/src/storage.c
index 375974a..be3bbf2 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -180,8 +180,10 @@ sdp_record_t *find_record_in_list(sdp_list_t *recs, const char *uuid)
/* Extract the uuid */
uuid_str = bt_uuid2string(svcclass->data);
- if (!uuid_str)
+ if (!uuid_str) {
+ sdp_list_free(svcclass, free);
continue;
+ }
if (!strcasecmp(uuid_str, uuid)) {
sdp_list_free(svcclass, free);
--
1.7.9.5
Hi Jaganath,
On Fri, Jan 04, 2013, Jaganath Kanakkassery wrote:
> If bt_uuid2string() returns NULL then svcclass has to be freed
> ---
> src/storage.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Both patches have been applied. Thanks.
Johan
Since g_str_has_prefix() has been used with the output buffer of read
it should be NULL terminated
---
src/rfkill.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rfkill.c b/src/rfkill.c
index bac9efd..51591cb 100644
--- a/src/rfkill.c
+++ b/src/rfkill.c
@@ -114,7 +114,7 @@ static gboolean rfkill_event(GIOChannel *chan,
memset(sysname, 0, sizeof(sysname));
- if (read(fd, sysname, sizeof(sysname)) < 4) {
+ if (read(fd, sysname, sizeof(sysname) - 1) < 4) {
close(fd);
return TRUE;
}
--
1.7.9.5