Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2002:
[Freeciv-Dev] Re: [FreeCiv-Cvs] rfalke: Add the ability to choose from a
Home

[Freeciv-Dev] Re: [FreeCiv-Cvs] rfalke: Add the ability to choose from a

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [FreeCiv-Cvs] rfalke: Add the ability to choose from a set of stri...
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Mon, 16 Sep 2002 12:44:46 +0200

On Sun, Sep 15, 2002 at 11:14:09PM -0500, Jason Short wrote:
> Raimar Falke wrote:
> >On Thu, Aug 15, 2002 at 01:31:03PM -0700, freeciv@xxxxxxxxxxxxxxxxxxx 
> >wrote:
> >
> >>Add the ability to choose from a set of string options in the local
> >>options dialog. A new callback function p_string_vals was added to the
> >>client options to return this set.
> >>
> >>This new input method is currently used for the audio plugin, the
> >>soundset and the tileset. For the last two the new function
> >>datafilelist (in common/shared) was added.
> >
> >
> >Splint found an error:
> >
> >common/shared.c: (in function datafilelist)
> >common/shared.c:903:47: Value file_list[] may be used after being released 
> >(in post loop test)
> >  Memory (through fetch) is used after it may have been released (either 
> >  by passing as an only param or assigning to an only global). (Use 
> >  -strictusereleased to inhibit warning)
> >   common/shared.c:904:12: Storage file_list[] released
> 
> Looks like this is a spurious warning.  There is a 
> strcmp(file_list[j]...) in the test of the for-loop, and a 
> free(file_list[j]) in the body of the loop, but the value of j changes 
> so that no memory is freed twice.

Yes you are right. The order is increment and than the
loop-test.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Understanding is a three-edged sword; 
  your side, their side, and the truth."
    -- a well-known Vorlon



[Prev in Thread] Current Thread [Next in Thread]