[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] hw/bt/sdp: Fix resource leak det

From: Stefan Weil
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] hw/bt/sdp: Fix resource leak detect by coverity
Date: Sat, 14 Mar 2015 07:57:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0

Am 14.03.2015 um 04:42 schrieb Shannon Zhao:
Free data in function sdp_attr_write after use.

Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
  hw/bt/sdp.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/hw/bt/sdp.c b/hw/bt/sdp.c
index 218e075..8e6d5e3 100644
--- a/hw/bt/sdp.c
+++ b/hw/bt/sdp.c
@@ -735,6 +735,7 @@ static void sdp_service_record_build(struct 
sdp_service_record_s *record,
          record->attribute_list[record->attributes ++].len = len;
          data += len;
+    g_free(data);

No, here more work is needed. data is no longer the original data,
because two lines above it is modified.

/* Sort the attribute list by the AttributeID */
      qsort(record->attribute_list, record->attributes,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]