URL:
  <http://gna.org/bugs/?15315>

                 Summary: memory leak in server/ruleset.c :
load_ruleset_units()
                 Project: Freeciv
            Submitted by: None
            Submitted on: Monday 02/08/2010 at 21:41 CET
                Category: general
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: jkl102...@yahoo.com
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any
        Operating System: None
         Planned Release: 

    _______________________________________________________

Details:

The variable csec is declared as a

struct section_list *

at line 986.  Its value is set at line 1118 using the function

secfile_sections_by_name_prefix()

However, it is freed using plain free() on line 1485.  The proper function
for freeing a struct section_list is called

section_list_free()

which is defined via the speclist macro mechanism, so its definition does not
appear anywhere in the actual source code.

The impact of this bug is that internal data associated with the list is
never freed.  Apparently it has existed since 2006.

The fix is to replace free() with section_list_free() on line 1485.  Note the
'sec' variable, which has the same type as csec, is freed using the proper
function on the very next line.

JKL




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?15315>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to