delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2013/03/27/14:45:16

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Received: by 10.224.157.1 with SMTP id z1mr8553911qaw.8.1364409121281;
Wed, 27 Mar 2013 11:32:01 -0700 (PDT)
X-Received: by 10.49.3.42 with SMTP id 10mr1505887qez.23.1364409121255; Wed,
27 Mar 2013 11:32:01 -0700 (PDT)
Newsgroups: comp.os.msdos.djgpp
Date: Wed, 27 Mar 2013 11:32:01 -0700 (PDT)
In-Reply-To: <kiudq6$g2h$1@speranza.aioe.org>
Complaints-To: groups-abuse AT google DOT com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2.173.27.66; posting-account=v5xbdQoAAAAOGc9Ccc-kLZyobvPlN3Qr
NNTP-Posting-Host: 2.173.27.66
References: <261476b1-c137-495d-95df-a92075cd9960 AT googlegroups DOT com>
<2245ebea-be44-4a40-8b2f-7ef5e0e67157 AT googlegroups DOT com> <D85EE936F5F24E8E8E2EA7C8C3FB79C5 AT dev DOT null>
<5f806b56-af98-4f72-8984-a944be9348a4 AT googlegroups DOT com> <abe3aa9a-9e77-4df1-9177-71daeae5b51f AT googlegroups DOT com>
<6b49a77b-dcba-4c23-8a29-4ac0263e7713 AT googlegroups DOT com> <kiudq6$g2h$1 AT speranza DOT aioe DOT org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cda1186d-9ab0-4105-8818-175b07526c7f@googlegroups.com>
Subject: Re: DJGPP scandir and alphasort example code
From: Georg Potthast <dosusb AT googlemail DOT com>
Injection-Date: Wed, 27 Mar 2013 18:32:01 +0000
X-Received-Bytes: 2202
Bytes: 2419
Lines: 31
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r2RIj2VG018152
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Am Mittwoch, 27. März 2013 10:23:18 UTC+1 schrieb Martin Str|mberg:
> Georg Potthast <dosusb AT googlemail DOT com> wrote:
> 
> > Anyway below is what I wanted to post. Maybe someone can tell what is wrong with the glob() usage part.
> 
> 
> 
> I don't know. I just want to warn you about your memory leak.
> 
> 
> 
> > 	//dynamic tdir array allocation
> 
> > 	static struct dirent *tdir;
> 
> > 	tdir = (struct dirent*) calloc(cnt,sizeof(struct dirent));
> 
> 
> 
> I can't see where you free tdir. Memory leak.
> 
> 
> 
> 
> 
> -- 
> 
> MartinS

That variable is unused in this version of the code. You can remove tdir and it will still work. And thus remove the memory leak.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019