Fix:core:avoid double free on the return value of get_int_var()
authortegzed <tegzed@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sun, 9 Oct 2011 15:32:23 +0000 (15:32 +0000)
committertegzed <tegzed@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sun, 9 Oct 2011 15:32:23 +0000 (15:32 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4837 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/navit.c

index 859ead7..5c0612d 100644 (file)
@@ -1033,7 +1033,7 @@ navit_cmd_get_int_var(struct navit *this, char *function, struct attr **in, stru
        if (in && in[0] && ATTR_IS_STRING(in[0]->type) && in[0]->u.str) {
                struct attr*ret = g_hash_table_lookup(cmd_int_var_hash, in[0]->u.str);
                 if(ret) {
-                       list[0] = ret;
+                       list[0] = attr_dup(ret);
                }
                else {
                        struct attr*val = g_new0(struct attr,1);