From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f02a96c85b47538d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.73.233 with SMTP id o9mr4202651pbv.8.1320891036687; Wed, 09 Nov 2011 18:10:36 -0800 (PST) MIME-Version: 1.0 Path: h5ni19256pba.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Read Windows login username in Ada 95 Date: Thu, 10 Nov 2011 02:09:39 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <18650574.2609.1320888091484.JavaMail.geo-discussion-forums@yqjc16> NNTP-Posting-Host: Lf0Nl3CcQzx+ocHx9cmuGg.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Tom's custom newsreader Xref: news1.google.com comp.lang.ada:18897 Date: 2011-11-10T02:09:39+00:00 List-Id: > > Who is responsible for freeing Answer_Ptr? > > If I included an Free(Answer_Ptr), would it solve this? I believe the C function getenv returns a pointer to a system area that has the relevant string, it does not allocate a new buffer and copy the string to the buffer. The corresponding Windows functions make a copy in the user-supplied buffer (presumably as an atomic operation).