1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-28 09:38:38 +00:00

Fix $combine reading unallocated memory

This commit is contained in:
Nikolas Garofil 2010-02-22 13:02:24 +01:00
parent b88d69dbfc
commit e50ec9ded6
3 changed files with 4 additions and 5 deletions

View File

@ -181,7 +181,6 @@ void free_combine(struct text_object *obj)
free(cd->seperation); free(cd->seperation);
free(cd->right); free(cd->right);
free_text_objects(obj->sub); free_text_objects(obj->sub);
free(obj->sub); free_and_zero(obj->sub);
free(obj->data.opaque); free_and_zero(obj->data.opaque);
obj->data.opaque = NULL;
} }

View File

@ -682,8 +682,6 @@ void conftree_empty(struct conftree* tree) {
struct conftree *currentconffile; struct conftree *currentconffile;
#define free_and_zero(PTR) if(PTR) { free(PTR); PTR = NULL; }
static void extract_variable_text(const char *p) static void extract_variable_text(const char *p)
{ {
free_text_objects(&global_root_object); free_text_objects(&global_root_object);

View File

@ -28,6 +28,8 @@
* *
*/ */
#define free_and_zero(PTR) if(PTR) { free(PTR); PTR = NULL; }
#ifndef _CONKY_CORE_H_ #ifndef _CONKY_CORE_H_
#define _CONKY_CORE_H_ #define _CONKY_CORE_H_