Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2000:
[Freeciv-Dev] Re: Ruleset Question
Home

[Freeciv-Dev] Re: Ruleset Question

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: iquin@xxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Ruleset Question
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Fri, 30 Jun 2000 13:02:14 +1000 (EST)

=?BIG5?B?vbKr7bXY?= <iquin@xxxxxxxxxx> wrote:

> Is the caller responsible for free()ing memory returned by
> secfile_lookup_str_default()? 

No, the lookup_str functions return a pointer into to the internal
registry data structures, which should definitely not be freed by the 
caller.  (They are free-d in section_file_free(); actually, if you tried 
it free() would probably segfault or similar, because the strings are 
actually pointers into an sbuffer, rather than individually malloced 
objects.)

secfile_lookup_str_vec() is a bit different but has a comment which 
explains things (and in passing implies the above).

-- David



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