Bugfix: make sure $else works correct and without memleaks
authorNikolas Garofil <garo@dunaldi.garofil.be>
Mon, 16 Nov 2009 07:39:05 +0000 (08:39 +0100)
committerNikolas Garofil <garo@dunaldi.garofil.be>
Mon, 16 Nov 2009 07:39:05 +0000 (08:39 +0100)
src/conky.c
src/core.c

index e9dcb05..6f20bd5 100644 (file)
@@ -1167,7 +1167,7 @@ void generate_text_internal(char *p, int p_max_size,
                                 * Do Ninja jump here: without leaving traces.
                                 * This is to prevent us from stale jumped flags.
                                 */
-                               obj = obj->sub;
+                               obj = obj->special_data;
                                continue;
                        }
                        OBJ(endif) {
index 77d7e5b..9dc3ed5 100644 (file)
@@ -1781,7 +1781,7 @@ void free_text_objects(struct text_object *root, int internal)
 #ifdef XMMS2
                if(obj->type == OBJ_if_xmms2_connected) type_is_if = 1;
 #endif
-               if(obj->special_data && type_is_if == 0) free(obj->special_data);
+               if(obj->special_data && obj->type != OBJ_else && type_is_if == 0) free(obj->special_data);
                free(obj);
        }
 #undef data