Fix memory leak for battery tooltips
Instead of returning a const string, that is fed into strdup, tooltip functions are now supposed to return allocated strings. This fixes a memory leak in the battery tooltip. This is used instead of simply freeing the memory in the battery tooltip function, since it also avoids a uselesss strdup().
This commit is contained in:
@@ -38,10 +38,10 @@
|
||||
timeout* urgent_timeout;
|
||||
GSList* urgent_list;
|
||||
|
||||
const char* task_get_tooltip(void* obj)
|
||||
char* task_get_tooltip(void* obj)
|
||||
{
|
||||
Task* t = obj;
|
||||
return t->title;
|
||||
return strdup(t->title);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user