delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2013/03/27/12:00:31

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Martin Str|mberg <ams AT dexter DOT ludd DOT ltu DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP scandir and alphasort example code
Date: Wed, 27 Mar 2013 09:23:18 +0000 (UTC)
Organization: Aioe.org NNTP Server
Lines: 14
Message-ID: <kiudq6$g2h$1@speranza.aioe.org>
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>
NNTP-Posting-Host: ftvAZcRvOze4hbePWaim7g.user.speranza.aioe.org
X-Complaints-To: abuse AT aioe DOT org
User-Agent: tin/1.4.7-20030322 ("Suggestions") (UNIX) (SunOS/5.9 (sun4u))
X-Notice: Filtered by postfilter v. 0.8.2
Bytes: 1400
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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

- Raw text -


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