Nп/п : 39 из 100
 От   : candycanearter07                    2:5075/128        15 сен 23 09:40:00
 К    : Theo                                                  15 сен 23 17:41:01
 Тема : Re: Weird code crash
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 3@dont-email.me> f94af01c
@REPLY: 5Arqz@news.chiark.greenend.org.uk>
8f646d19
@REPLYADDR candycanearter07 <no@thanks.net>
@REPLYTO 2:5075/128 candycanearter07
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 3@dont-email.me>
@RFC-References: 1@dont-email.me>
<ygamsxoixhx.fsf@akutech.de> 4@dont-email.me> <ygail8biyxm.fsf@akutech.de>
1@dont-email.me> <ygaedizitb9.fsf@akutech.de> 2@dont-email.me>
5Arqz@news.chiark.greenend.org.uk>
@TZUTC: -0500
@PID: Mozilla Thunderbird
@TID: FIDOGATE-5.12-ge4e8b94
On 9/15/23 08:23, Theo wrote:
> In comp.sys.raspberry-pi The Natural Philosopher <tnp@invalid.invalid> wrote:
>> On 15/09/2023 12:12, Ralf Fassel wrote:
>>> |                             {
>>> |                             *q++=0;
>>> |                             thermometers[i].name=strdup(p); //
>>> |                             make a copy of the name and attach it
>>> |                             to our thermometer structure
>>>
>>> Memory leak if thermometers[i].name already contains something.
>>>
>> further up the line...
>>
>>          bzero(filbuf,sizeof(filbuf));
>>          /** first thing to do is clean any allocated memory used to store
>> values. **/
>>          for(i=0;i >>                  free(thermometers[i].name);

> You could get a SIGABRT if you were trying to free something that was
> already freed.  Are you sure those are interlocked such that for each i you
> call strdup() exactly once, and subsequently free() exactly once?  If there
> was some code path that was breaking out of the loop or similar you might
> get such behaviour.

> Theo

I thought double free was a SIGSEGV?
-- 
--
user  is generated from /dev/urandom

--- Mozilla Thunderbird
 * Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх