All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shannon Zhao <zhaoshenglong@huawei.com>
To: Stefan Weil <sw@weilnetz.de>, <qemu-devel@nongnu.org>
Cc: peter.maydell@linaro.org, hangaohuai@huawei.com,
	qemu-trivial@nongnu.org, mjt@tls.msk.ru,
	peter.huangpeng@huawei.com, shannon.zhao@linaro.org,
	pbonzini@redhat.com
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] hw/bt/sdp: Fix resource leak detect by coverity
Date: Sat, 14 Mar 2015 17:15:23 +0800	[thread overview]
Message-ID: <5503FC2B.3090004@huawei.com> (raw)
In-Reply-To: <5503DBDB.9040804@weilnetz.de>

On 2015/3/14 14:57, Stefan Weil wrote:
> Am 14.03.2015 um 04:42 schrieb Shannon Zhao:
>> Free data in function sdp_attr_write after use.
>>
>> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
>> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
>> ---
>>   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.

Thanks for pointing out.

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



WARNING: multiple messages have this Message-ID (diff)
From: Shannon Zhao <zhaoshenglong@huawei.com>
To: Stefan Weil <sw@weilnetz.de>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, hangaohuai@huawei.com,
	qemu-trivial@nongnu.org, mjt@tls.msk.ru,
	peter.huangpeng@huawei.com, shannon.zhao@linaro.org,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] hw/bt/sdp: Fix resource leak detect by coverity
Date: Sat, 14 Mar 2015 17:15:23 +0800	[thread overview]
Message-ID: <5503FC2B.3090004@huawei.com> (raw)
In-Reply-To: <5503DBDB.9040804@weilnetz.de>

On 2015/3/14 14:57, Stefan Weil wrote:
> Am 14.03.2015 um 04:42 schrieb Shannon Zhao:
>> Free data in function sdp_attr_write after use.
>>
>> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
>> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
>> ---
>>   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.

Thanks for pointing out.

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

  reply	other threads:[~2015-03-14  9:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-14  3:42 [Qemu-trivial] [PATCH] hw/bt/sdp: Fix resource leak detect by coverity Shannon Zhao
2015-03-14  3:42 ` [Qemu-devel] " Shannon Zhao
2015-03-14  6:57 ` [Qemu-trivial] " Stefan Weil
2015-03-14  6:57   ` Stefan Weil
2015-03-14  9:15   ` Shannon Zhao [this message]
2015-03-14  9:15     ` Shannon Zhao
  -- strict thread matches above, loose matches on Subject: below --
2015-03-14  9:47 [Qemu-trivial] " Shannon Zhao
2015-03-14 10:07 ` [Qemu-trivial] [Qemu-devel] " Stefan Weil
2015-03-15  9:21   ` [Qemu-trivial] " Paolo Bonzini
2015-03-15 10:23     ` Michael Tokarev
2015-03-15 14:11       ` Paolo Bonzini
2015-03-16  7:29         ` [Qemu-trivial] [Qemu-devel] " Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5503FC2B.3090004@huawei.com \
    --to=zhaoshenglong@huawei.com \
    --cc=hangaohuai@huawei.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=shannon.zhao@linaro.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.