>From 1f18fa648317b4ac03f20cd1fe4d4be3dbf2744b Mon Sep 17 00:00:00 2001
From: Tobias Stoeckmann <[email protected]>
Date: Thu, 3 May 2012 17:45:28 +0200
Subject: [PATCH] Use proper (w)free functions for (w)malloced data.
---
src/appmenu.c | 2 +-
src/event.c | 4 ++--
src/rootmenu.c | 10 +++++-----
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/appmenu.c b/src/appmenu.c
index 7c6e6a3..6aac338 100644
--- a/src/appmenu.c
+++ b/src/appmenu.c
@@ -154,7 +154,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win,
char **slist, int coun
if (!entry) {
wMenuDestroy(menu, True);
wwarning("appmenu: out of memory creating menu
for window %lx", win);
- wfree(data);
+ free(data);
return NULL;
}
if (rtext[0] != 0)
diff --git a/src/event.c b/src/event.c
index 50c5a56..2eb0248 100644
--- a/src/event.c
+++ b/src/event.c
@@ -178,7 +178,7 @@ WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *
callback, void *cdata)
handler->client_data = cdata;
if (!deathHandlers)
- deathHandlers = WMCreateArrayWithDestructor(8, wfree);
+ deathHandlers = WMCreateArrayWithDestructor(8, free);
WMAddToArray(deathHandlers, handler);
@@ -192,7 +192,7 @@ static void wdelete_death_handler(WMagicNumber id)
if (!handler || !deathHandlers)
return;
- /* array destructor will call wfree(handler) */
+ /* array destructor will call free(handler) */
WMRemoveFromArray(deathHandlers, handler);
}
diff --git a/src/rootmenu.c b/src/rootmenu.c
index cca29ae..c168279 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -783,7 +783,7 @@ static WMenuEntry *addMenuEntry(WMenu * menu, char *title,
char *shortcut, char
dummy = wMenuCreate(scr, title, False);
dummy->on_destroy = removeShortcutsForMenu;
entry = wMenuAddCallback(menu, title, constructMenu,
path);
- entry->free_cdata = free;
+ entry->free_cdata = wfree;
wMenuEntrySetCascade(menu, entry, dummy);
}
} else if (strcmp(command, "EXEC") == 0) {
@@ -791,7 +791,7 @@ static WMenuEntry *addMenuEntry(WMenu * menu, char *title,
char *shortcut, char
wwarning(_("%s:missing parameter for menu command
\"%s\""), file_name, command);
else {
entry = wMenuAddCallback(menu, title, execCommand,
wstrconcat("exec ", params));
- entry->free_cdata = free;
+ entry->free_cdata = wfree;
shortcutOk = True;
}
} else if (strcmp(command, "SHEXEC") == 0) {
@@ -799,7 +799,7 @@ static WMenuEntry *addMenuEntry(WMenu * menu, char *title,
char *shortcut, char
wwarning(_("%s:missing parameter for menu command
\"%s\""), file_name, command);
else {
entry = wMenuAddCallback(menu, title, execCommand,
wstrdup(params));
- entry->free_cdata = free;
+ entry->free_cdata = wfree;
shortcutOk = True;
}
} else if (strcmp(command, "EXIT") == 0) {
@@ -844,7 +844,7 @@ static WMenuEntry *addMenuEntry(WMenu * menu, char *title,
char *shortcut, char
shortcutOk = True;
} else if (strcmp(command, "RESTART") == 0) {
entry = wMenuAddCallback(menu, title, restartCommand, params ?
wstrdup(params) : NULL);
- entry->free_cdata = free;
+ entry->free_cdata = wfree;
shortcutOk = True;
} else if (strcmp(command, "SAVE_SESSION") == 0) {
entry = wMenuAddCallback(menu, title, saveSessionCommand, NULL);
@@ -1344,7 +1344,7 @@ static WMenu *readMenuDirectory(WScreen * scr, char
*title, char **path, char *c
}
}
}
- wfree(buffer);
+ free(buffer);
}
closedir(dir);
--
1.7.6
--
To unsubscribe, send mail to [email protected].