1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-06-11 12:55:24 +02:00

- Replaced all free() with wfree() where appropriate

- Fixed some memory leaks
This commit is contained in:
dan
2000-10-31 14:57:22 +00:00
parent 581ab58f70
commit 497e34b6b8
72 changed files with 545 additions and 539 deletions
+14 -14
View File
@@ -108,7 +108,7 @@ wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
dicon->icon = wIconCreateWithIconFile(scr, path, tile);
if (path)
free(path);
wfree(path);
#ifdef XDND
wXDNDMakeAwareness(dicon->icon->core->window);
#endif
@@ -159,7 +159,7 @@ wAppIconCreate(WWindow *leader_win)
/* Something's wrong. wApplicationOf() should always return a
* valid structure. Rather than violate assumptions, bail. -cls
*/
free(applist);
wfree(applist);
wrelease(aicon);
return NULL;
}
@@ -256,24 +256,24 @@ wAppIconDestroy(WAppIcon *aicon)
RemoveFromStackList(aicon->icon->core);
wIconDestroy(aicon->icon);
if (aicon->command)
free(aicon->command);
wfree(aicon->command);
#ifdef OFFIX_DND
if (aicon->dnd_command)
free(aicon->dnd_command);
wfree(aicon->dnd_command);
#endif
if (aicon->wm_instance)
free(aicon->wm_instance);
wfree(aicon->wm_instance);
if (aicon->wm_class)
free(aicon->wm_class);
wfree(aicon->wm_class);
#ifdef REDUCE_APPICONS
/* There should never be a list but just in case */
if (aicon->applist != NULL) {
aptmp = aicon->applist;
while (aptmp->next) {
aptmp = aptmp->next;
free(aptmp->prev);
wfree(aptmp->prev);
}
free(aptmp);
wfree(aptmp);
}
#endif
@@ -389,7 +389,7 @@ updateDockNumbers(WScreen *scr)
scr->icon_title_font, 3, 2, ws_numbers, length);
XFreeGC(dpy, numbers_gc);
free(ws_numbers);
wfree(ws_numbers);
}
#endif /* WS_INDICATOR */
@@ -485,7 +485,7 @@ wAppIconReduceAppCount(WApplication *wapp)
if (applist == wapp->app_icon->applist)
wapp->app_icon->applist = applist->next;
free(applist);
wfree(applist);
if (wapp->app_icon->applist != NULL)
wapp->app_icon->main_window = wapp->app_icon->applist->wapp->main_window;
@@ -543,7 +543,7 @@ setIconCallback(WMenu *menu, WMenuEntry *entry)
if (result && !icon->destroyed) {
if (file[0]==0) {
free(file);
wfree(file);
file = NULL;
}
if (!wIconChangeImageFile(icon->icon, file)) {
@@ -555,7 +555,7 @@ setIconCallback(WMenu *menu, WMenuEntry *entry)
wAppIconPaint(icon);
}
if (file)
free(file);
wfree(file);
}
icon->editing = 0;
wrelease(icon);
@@ -589,7 +589,7 @@ killCallback(WMenu *menu, WMenuEntry *entry)
}
wrelease(wapp->main_window_desc);
free(buffer);
wfree(buffer);
WCHANGE_STATE(WSTATE_NORMAL);
}
@@ -619,7 +619,7 @@ openApplicationMenu(WApplication *wapp, int x, int y)
if (!scr->icon_menu) {
scr->icon_menu = createApplicationMenu(scr);
free(scr->icon_menu->entries[1]->text);
wfree(scr->icon_menu->entries[1]->text);
}
menu = scr->icon_menu;
+6 -6
View File
@@ -163,7 +163,7 @@ saveIconNameFor(char *iconPath, char *wm_instance, char *wm_class)
}
key = PLMakeString(tmp);
free(tmp);
wfree(tmp);
adict = PLGetDictionaryEntry(dict, key);
iconk = PLMakeString("Icon");
@@ -215,13 +215,13 @@ wApplicationExtractDirPackIcon(WScreen *scr, char *path,
iconPath = tmp;
}
if (!iconPath)
free(tmp);
wfree(tmp);
}
if (iconPath) {
saveIconNameFor(iconPath, wm_instance, wm_class);
free(iconPath);
wfree(iconPath);
}
}
@@ -237,7 +237,7 @@ extractClientIcon(WAppIcon *icon)
saveIconNameFor(path, icon->wm_instance, icon->wm_class);
free(path);
wfree(path);
return True;
}
@@ -284,7 +284,7 @@ wApplicationCreate(WScreen *scr, Window main_window)
wapp->main_window = main_window;
wapp->main_window_desc = makeMainWindow(scr, main_window);
if (!wapp->main_window_desc) {
free(wapp);
wfree(wapp);
return NULL;
}
@@ -508,7 +508,7 @@ wApplicationDestroy(WApplication *wapp)
XSaveContext(dpy, wwin->client_win, wWinContext,
(XPointer)&wwin->client_descriptor);
}
free(wapp);
wfree(wapp);
#ifdef DEBUG
printf("Destroyed application for %x\n", (unsigned)main_window);
+1 -1
View File
@@ -176,7 +176,7 @@ parseMenuCommand(WScreen *scr, Window win, char **slist, int count, int *index)
wMenuDestroy(menu, True);
wwarning("appmenu: out of memory creating menu for window %x",
slist[*index], win);
free(data);
wfree(data);
return NULL;
}
if (rtext[0]!=0)
+1 -1
View File
@@ -432,7 +432,7 @@ wBalloonEnteredObject(WScreen *scr, WObjDescriptor *object)
}
if (scr->balloon->text)
free(scr->balloon->text);
wfree(scr->balloon->text);
scr->balloon->text = NULL;
if (!object) {
+18 -18
View File
@@ -933,8 +933,8 @@ wDefaultsDestroyDomain(WDDomain *domain)
{
if (domain->dictionary)
PLRelease(domain->dictionary);
free(domain->path);
free(domain);
wfree(domain->path);
wfree(domain);
}
@@ -1335,7 +1335,7 @@ wDefaultUpdateIcons(WScreen *scr)
RImage *new_image;
if (aicon->icon->file)
free(aicon->icon->file);
wfree(aicon->icon->file);
aicon->icon->file = wstrdup(file);
new_image = wDefaultGetImage(scr, aicon->wm_instance,
@@ -1360,7 +1360,7 @@ wDefaultUpdateIcons(WScreen *scr)
RImage *new_image;
if (wwin->icon->file)
free(wwin->icon->file);
wfree(wwin->icon->file);
wwin->icon->file = wstrdup(file);
new_image = wDefaultGetImage(scr, wwin->wm_instance,
@@ -1679,7 +1679,7 @@ again:
ptr--; *(ptr--) = 0;
if (*(char**)addr!=NULL) {
free(*(char**)addr);
wfree(*(char**)addr);
}
*(char**)addr = data;
@@ -1905,9 +1905,9 @@ parse_texture(WScreen *scr, proplist_t pl)
elem = PLGetArrayElement(pl, i+1);
if (!elem || !PLIsString(elem)) {
for (--i; i>=0; --i) {
free(colors[i]);
wfree(colors[i]);
}
free(colors);
wfree(colors);
return NULL;
}
val = PLGetString(elem);
@@ -1915,9 +1915,9 @@ parse_texture(WScreen *scr, proplist_t pl)
if (!XParseColor(dpy, scr->w_colormap, val, &color)) {
wwarning(_("\"%s\" is not a valid color name"), val);
for (--i; i>=0; --i) {
free(colors[i]);
wfree(colors[i]);
}
free(colors);
wfree(colors);
return NULL;
} else {
colors[i] = wmalloc(sizeof(RColor));
@@ -2068,7 +2068,7 @@ parse_texture(WScreen *scr, proplist_t pl)
for (i = 0; i < argc - 1; i++) {
elem = PLGetArrayElement(pl, 3 + i);
if (!elem || !PLIsString(elem)) {
free(argv);
wfree(argv);
return NULL;
}
@@ -2710,13 +2710,13 @@ parse_cursor(WScreen *scr, proplist_t pl, Cursor *cursor)
}
elem = PLGetArrayElement(pl, 2);
if (!elem || !PLIsString(elem)) {
free(bitmap_name);
wfree(bitmap_name);
return(status);
}
val = PLGetString(elem);
mask_name = FindImage(wPreferences.pixmap_path, val);
if (!mask_name) {
free(bitmap_name);
wfree(bitmap_name);
wwarning(_("could not find cursor bitmap file \"%s\""), val);
return(status);
}
@@ -2735,8 +2735,8 @@ parse_cursor(WScreen *scr, proplist_t pl, Cursor *cursor)
}
check_bitmap_status(bitmap_status, bitmap_name, bitmap);
check_bitmap_status(mask_status, mask_name, mask);
free(bitmap_name);
free(mask_name);
wfree(bitmap_name);
wfree(mask_name);
}
return(status);
}
@@ -3254,7 +3254,7 @@ setWorkspaceSpecificBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
SendHelperMessage(scr, 'S', i+1, str);
free(str);
wfree(str);
} else {
SendHelperMessage(scr, 'U', i+1, NULL);
}
@@ -3280,7 +3280,7 @@ setWorkspaceBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
str = PLGetDescription(value);
if (str) {
SendHelperMessage(scr, 'S', 0, str);
free(str);
wfree(str);
SendHelperMessage(scr, 'C', scr->current_workspace+1, NULL);
} else {
SendHelperMessage(scr, 'U', 0, NULL);
@@ -3297,9 +3297,9 @@ setWorkspaceBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
sprintf(command, "wmsetbg -d -S -p '%s' &", text);
else
sprintf(command, "wmsetbg -d -p '%s' &", text);
free(text);
wfree(text);
system(command);
free(command);
wfree(command);
}
PLRelease(value);
+22 -22
View File
@@ -163,7 +163,7 @@ wInputDialog(WScreen *scr, char *title, char *message, char **text)
return False;
else {
if (*text)
free(*text);
wfree(*text);
*text = result;
return True;
@@ -232,8 +232,8 @@ listPixmaps(WScreen *scr, WMList *lPtr, char *path)
strcat(msg, path);
wMessageDialog(scr, _("Error"), msg, _("OK"), NULL, NULL);
free(msg);
free(apath);
wfree(msg);
wfree(apath);
return;
}
@@ -260,7 +260,7 @@ listPixmaps(WScreen *scr, WMList *lPtr, char *path)
WMSortListItems(lPtr);
closedir(dir);
free(apath);
wfree(apath);
panel->preview = True;
}
@@ -324,10 +324,10 @@ listCallback(void *self, void *data)
strcpy(path, tmp);
strcat(path, "/");
strcat(path, iconFile);
free(tmp);
wfree(tmp);
WMSetTextFieldText(panel->fileField, path);
setViewedImage(panel, path);
free(path);
wfree(path);
}
}
@@ -350,10 +350,10 @@ listIconPaths(WMList *lPtr)
* directories searched */
if (access(tmp, X_OK)==0)
WMAddListItem(lPtr, path);
free(tmp);
wfree(tmp);
} while ((path=strtok(NULL, ":"))!=NULL);
free(paths);
wfree(paths);
}
@@ -382,10 +382,10 @@ drawIconProc(WMList *lPtr, int index, Drawable d, char *text,
dirfile = wexpandpath(WMGetListSelectedItem(panel->dirList)->text);
buffer = wmalloc(strlen(dirfile)+strlen(text)+4);
sprintf(buffer, "%s/%s", dirfile, text);
free(dirfile);
wfree(dirfile);
pixmap = WMCreatePixmapFromFile(WMWidgetScreen(panel->win), buffer);
free(buffer);
wfree(buffer);
if (!pixmap) {
WMRemoveListItem(lPtr, index);
return;
@@ -479,7 +479,7 @@ buttonCallback(void *self, void *clientData)
path = WMGetFilePanelFile(op);
WMSetTextFieldText(panel->fileField, path);
setViewedImage(panel, path);
free(path);
wfree(path);
}
WMDestroyFilePanel(op);
}
@@ -612,7 +612,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
wwin = wManageInternalWindow(scr, parent, None, tmp,
(scr->scr_width - 450)/2,
(scr->scr_height - 280)/2, 450, 280);
free(tmp);
wfree(tmp);
}
/* put icon paths in the list */
@@ -636,7 +636,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
* would be loaded by default with the current search path */
*file = WMGetListSelectedItem(panel->iconList)->text;
if ((*file)[0]==0) {
free(*file);
wfree(*file);
*file = NULL;
} else {
defaultPath = FindImage(wPreferences.icon_path, *file);
@@ -646,9 +646,9 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
*file = wantedPath;
} else {
*file = wstrdup(*file);
free(wantedPath);
wfree(wantedPath);
}
free(defaultPath);
wfree(defaultPath);
}
} else {
*file = NULL;
@@ -662,7 +662,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
wUnmanageWindow(wwin, False, False);
free(panel);
wfree(panel);
XDestroyWindow(dpy, parent);
@@ -738,7 +738,7 @@ destroyInfoPanel(WCoreWindow *foo, void *data, XEvent *event)
WMDestroyWidget(thePanel->win);
free(thePanel);
wfree(thePanel);
thePanel = NULL;
}
@@ -993,7 +993,7 @@ handleLogoPush(XEvent *event, void *data)
}
panel->icon = RLoadImage(panel->scr->rcontext, path, 0);
free(path);
wfree(path);
if (!panel->icon) {
broken = 1;
return;
@@ -1331,7 +1331,7 @@ destroyLegalPanel(WCoreWindow *foo, void *data, XEvent *event)
wUnmanageWindow(legalPanel->wwin, False, False);
free(legalPanel);
wfree(legalPanel);
legalPanel = NULL;
}
@@ -1494,7 +1494,7 @@ getWindowMakerIconImage(WMScreen *scr)
pix = WMCreatePixmapFromRImage(scr, image, 0);
RDestroyImage(image);
}
free(path);
wfree(path);
}
}
@@ -1631,7 +1631,7 @@ wShowCrashingDialogPanel(int whatSig)
WMUnmapWidget(panel->win);
WMDestroyWidget(panel->win);
free(panel);
wfree(panel);
return action;
}
@@ -1720,7 +1720,7 @@ destroyGNUstepPanel(WCoreWindow *foo, void *data, XEvent *event)
wUnmanageWindow(gnustepPanel->wwin, False, False);
free(gnustepPanel);
wfree(gnustepPanel);
gnustepPanel = NULL;
}
+43 -41
View File
@@ -216,7 +216,7 @@ renameCallback(WMenu *menu, WMenuEntry *entry)
wWorkspaceRename(dock->screen_ptr, wspace, name);
}
if (name) {
free(name);
wfree(name);
}
}
@@ -285,6 +285,8 @@ killCallback(WMenu *menu, WMenuEntry *entry)
wClientKill(icon->icon->owner);
}
}
wfree(buffer);
#endif /* !REDUCE_APPICONS */
icon->editing = 0;
@@ -599,7 +601,7 @@ keepIconsCallback(WMenu *menu, WMenuEntry *entry)
&command)) {
if (command && (command[0]==0 ||
(command[0]=='-' && command[1]==0))) {
free(command);
wfree(command);
command = NULL;
}
clickedIcon->command = command;
@@ -607,7 +609,7 @@ keepIconsCallback(WMenu *menu, WMenuEntry *entry)
} else {
clickedIcon->editing = 0;
if (command)
free(command);
wfree(command);
WMFreeBag(selectedIcons);
return;
}
@@ -969,7 +971,7 @@ updateWorkspaceMenu(WMenu *menu, WAppIcon *icon)
for (i=0; i<scr->workspace_count; i++) {
if (i < menu->entry_no) {
if (strcmp(menu->entries[i]->text,scr->workspaces[i]->name)!=0) {
free(menu->entries[i]->text);
wfree(menu->entries[i]->text);
strcpy(title, scr->workspaces[i]->name);
menu->entries[i]->text = wstrdup(title);
menu->flags.realized = 0;
@@ -1122,7 +1124,7 @@ dockMenuCreate(WScreen *scr, int type)
entry = wMenuAddCallback(menu, _("Rename Workspace"), renameCallback,
NULL);
free(entry->text);
wfree(entry->text);
entry->text = _("Rename Workspace");
entry = wMenuAddCallback(menu, _("Selected"), selectCallback, NULL);
@@ -1132,15 +1134,15 @@ dockMenuCreate(WScreen *scr, int type)
entry = wMenuAddCallback(menu, _("Select All Icons"),
selectIconsCallback, NULL);
free(entry->text);
wfree(entry->text);
entry->text = _("Select All Icons");
entry = wMenuAddCallback(menu, _("Keep Icon"), keepIconsCallback, NULL);
free(entry->text);
wfree(entry->text);
entry->text = _("Keep Icon");
entry = wMenuAddCallback(menu, _("Move Icon To"), NULL, NULL);
free(entry->text);
wfree(entry->text);
entry->text = _("Move Icon To");
scr->clip_submenu = makeWorkspaceMenu(scr);
if (scr->clip_submenu)
@@ -1148,7 +1150,7 @@ dockMenuCreate(WScreen *scr, int type)
entry = wMenuAddCallback(menu, _("Remove Icon"), removeIconsCallback,
NULL);
free(entry->text);
wfree(entry->text);
entry->text = _("Remove Icon");
wMenuAddCallback(menu, _("Attract Icons"), colectIconsCallback, NULL);
@@ -1159,7 +1161,7 @@ dockMenuCreate(WScreen *scr, int type)
wMenuAddCallback(menu, _("Unhide Here"), unhideHereCallback, NULL);
entry = wMenuAddCallback(menu, _("Hide"), hideCallback, NULL);
free(entry->text);
wfree(entry->text);
entry->text = _("Hide");
wMenuAddCallback(menu, _("Settings..."), settingsCallback, NULL);
@@ -1246,12 +1248,12 @@ wDockDestroy(WDock *dock)
}
if (wPreferences.auto_arrange_icons)
wArrangeIcons(dock->screen_ptr, True);
free(dock->icon_array);
wfree(dock->icon_array);
if (dock->menu && dock->type!=WM_CLIP)
wMenuDestroy(dock->menu, True);
if (dock->screen_ptr->last_dock == dock)
dock->screen_ptr->last_dock = NULL;
free(dock);
wfree(dock);
}
@@ -1294,7 +1296,7 @@ wClipIconPaint(WAppIcon *aicon)
WMDrawString(scr->wmscreen, win, gc, scr->clip_title_font, tx,
2, ws_number, nlength);
free(ws_name);
wfree(ws_name);
if (aicon->launching) {
XFillRectangle(dpy, aicon->icon->core->window, scr->stipple_gc,
@@ -1345,7 +1347,7 @@ make_icon_state(WAppIcon *btn)
name = PLMakeString(tmp);
free(tmp);
wfree(tmp);
forced = btn->forced_dock ? dYes : dNo;
@@ -1565,11 +1567,11 @@ restore_icon_state(WScreen *scr, proplist_t info, int type, int index)
if (!command || strcmp(command, "-")==0) {
if (command)
free(command);
wfree(command);
if (wclass)
free(wclass);
wfree(wclass);
if (winstance)
free(winstance);
wfree(winstance);
return NULL;
}
@@ -1577,11 +1579,11 @@ restore_icon_state(WScreen *scr, proplist_t info, int type, int index)
aicon = wAppIconCreateForDock(scr, command, winstance, wclass,
TILE_NORMAL);
if (wclass)
free(wclass);
wfree(wclass);
if (winstance)
free(winstance);
wfree(winstance);
if (command)
free(command);
wfree(command);
}
aicon->icon->core->descriptor.handle_mousedown = iconMouseDown;
@@ -1960,7 +1962,7 @@ wDockLaunchWithState(WDock *dock, WAppIcon *btn, WSavedState *state)
}
}
} else {
free(state);
wfree(state);
}
}
@@ -2121,7 +2123,7 @@ wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y)
&command)) {
if (command && (command[0]==0 ||
(command[0]=='-' && command[1]==0))) {
free(command);
wfree(command);
command = NULL;
}
icon->command = command;
@@ -2129,7 +2131,7 @@ wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y)
} else {
icon->editing = 0;
if (command)
free(command);
wfree(command);
/* If the target is the dock, reject the icon. If
* the target is the clip, make it an attracted icon
*/
@@ -2255,14 +2257,14 @@ moveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int x, int y)
&command)) {
if (command && (command[0]==0 ||
(command[0]=='-' && command[1]==0))) {
free(command);
wfree(command);
command = NULL;
}
icon->command = command;
} else {
icon->editing = 0;
if (command)
free(command);
wfree(command);
return False;
}
icon->editing = 0;
@@ -2364,12 +2366,12 @@ wDockDetach(WDock *dock, WAppIcon *icon)
wIconSelect(icon->icon);
if (icon->command) {
free(icon->command);
wfree(icon->command);
icon->command = NULL;
}
#ifdef OFFIX_DND
if (icon->dnd_command) {
free(icon->dnd_command);
wfree(icon->dnd_command);
icon->dnd_command = NULL;
}
#endif
@@ -2770,8 +2772,8 @@ wDockFindFreeSlot(WDock *dock, int *x_pos, int *y_pos)
break;
}
}
free(vmap);
free(hmap);
wfree(vmap);
wfree(hmap);
/* If found a slot, translate and return */
if (done) {
if (corner==C_NW || corner==C_NE) {
@@ -2870,7 +2872,7 @@ wDockFindFreeSlot(WDock *dock, int *x_pos, int *y_pos)
}
}
}
free(slot_map);
wfree(slot_map);
#undef XY2OFS
return done;
}
@@ -2934,9 +2936,9 @@ execCommand(WAppIcon *btn, char *command, WSavedState *state)
if (scr->flags.dnd_data_convertion_status || !cmdline) {
if (cmdline)
free(cmdline);
wfree(cmdline);
if (state)
free(state);
wfree(state);
return 0;
}
@@ -2944,9 +2946,9 @@ execCommand(WAppIcon *btn, char *command, WSavedState *state)
if (argv==NULL) {
if (cmdline)
free(cmdline);
wfree(cmdline);
if (state)
free(state);
wfree(state);
return 0;
}
@@ -2971,8 +2973,8 @@ execCommand(WAppIcon *btn, char *command, WSavedState *state)
exit(111);
}
while (argc > 0)
free(argv[--argc]);
free(argv);
wfree(argv[--argc]);
wfree(argv);
if (pid > 0) {
if (!state) {
@@ -2991,9 +2993,9 @@ execCommand(WAppIcon *btn, char *command, WSavedState *state)
wAddDeathHandler(pid, (WDeathHandler*)trackDeadProcess,
btn->dock);
} else if (state) {
free(state);
wfree(state);
}
free(cmdline);
wfree(cmdline);
return pid;
}
@@ -3207,7 +3209,7 @@ retry:
}
if (command)
free(command);
wfree(command);
if (wm_class)
XFree(wm_class);
@@ -4429,7 +4431,7 @@ wClipMakeIconOmnipresent(WAppIcon *aicon, int omnipresent)
aicon->omnipresent = 0;
if (aicon == scr->global_icons->aicon) {
tmp = scr->global_icons->next;
free(scr->global_icons);
wfree(scr->global_icons);
scr->global_icons = tmp;
scr->global_icon_count--;
} else {
@@ -4437,7 +4439,7 @@ wClipMakeIconOmnipresent(WAppIcon *aicon, int omnipresent)
while (tmp->next) {
if (tmp->next->aicon == aicon) {
tmp1 = tmp->next->next;
free(tmp->next);
wfree(tmp->next);
tmp->next = tmp1;
scr->global_icon_count--;
break;
+15 -15
View File
@@ -86,9 +86,9 @@ static void
updateCommand(WAppIcon *icon, char *command)
{
if (icon->command)
free(icon->command);
wfree(icon->command);
if (command && (command[0]==0 || (command[0]=='-' && command[1]==0))) {
free(command);
wfree(command);
command = NULL;
}
icon->command = command;
@@ -105,9 +105,9 @@ static void
updateDNDCommand(WAppIcon *icon, char *command)
{
if (icon->dnd_command)
free(icon->dnd_command);
wfree(icon->dnd_command);
if (command && (command[0]==0 || (command[0]=='-' && command[1]==0))) {
free(command);
wfree(command);
command = NULL;
}
icon->dnd_command = command;
@@ -130,7 +130,7 @@ updateSettingsPanelIcon(AppSettingsPanel *panel)
if (!path) {
wwarning(_("could not find icon %s, used in a docked application"),
file);
free(file);
wfree(file);
WMSetLabelImage(panel->iconLabel, NULL);
return;
} else {
@@ -150,8 +150,8 @@ updateSettingsPanelIcon(AppSettingsPanel *panel)
WMReleasePixmap(pixmap);
}
}
free(file);
free(path);
wfree(file);
wfree(path);
}
}
@@ -175,7 +175,7 @@ chooseIconCallback(WMWidget *self, void *clientData)
if (!panel->destroyed) {
if (result) {
WMSetTextFieldText(panel->iconField, file);
free(file);
wfree(file);
updateSettingsPanelIcon(panel);
}
@@ -200,7 +200,7 @@ panelBtnCallback(WMWidget *self, void *data)
if (panel->okBtn == btn) {
text = WMGetTextFieldText(panel->iconField);
if (text[0]==0) {
free(text);
wfree(text);
text = NULL;
}
if (!wIconChangeImageFile(panel->editedIcon->icon, text)) {
@@ -211,11 +211,11 @@ panelBtnCallback(WMWidget *self, void *data)
if (wMessageDialog(panel->wwin->screen_ptr, _("Error"), buf,
_("OK"), _("Ignore"), NULL) == WAPRDefault) {
if (text)
free(text);
free(buf);
wfree(text);
wfree(buf);
return;
}
free(buf);
wfree(buf);
} else {
WAppIcon *aicon = panel->editedIcon;
@@ -228,13 +228,13 @@ panelBtnCallback(WMWidget *self, void *data)
aicon->wm_class, text);
}
if (text)
free(text);
wfree(text);
/* cannot free text from this, because it will be not be duplicated
* in updateCommand */
text = WMGetTextFieldText(panel->commandField);
if (text[0]==0) {
free(text);
wfree(text);
text = NULL;
}
updateCommand(panel->editedIcon, text);
@@ -447,5 +447,5 @@ DestroyDockAppSettingsPanel(AppSettingsPanel *panel)
panel->editedIcon->editing = 0;
free(panel);
wfree(panel);
}
+1 -1
View File
@@ -193,7 +193,7 @@ wDeleteDeathHandler(WMagicNumber id)
WMRemoveFromBag(deathHandlers, handler);
free(handler);
wfree(handler);
}
+4 -4
View File
@@ -440,7 +440,7 @@ wFrameWindowDestroy(WFrameWindow *fwin)
wCoreDestroy(fwin->core);
if (fwin->title)
free(fwin->title);
wfree(fwin->title);
for (i=0; i < (fwin->flags.single_texture ? 1 : 3); i++) {
FREE_PIXMAP(fwin->title_back[i]);
@@ -453,7 +453,7 @@ wFrameWindowDestroy(WFrameWindow *fwin)
}
}
free(fwin);
wfree(fwin);
}
@@ -1100,7 +1100,7 @@ wFrameWindowPaint(WFrameWindow *fwin)
title, titlelen);
#endif /* DRAWSTRING_PLUGIN */
free(title);
wfree(title);
if (fwin->left_button)
handleButtonExpose(&fwin->left_button->descriptor, NULL);
@@ -1247,7 +1247,7 @@ wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title)
}
if (fwin->title)
free(fwin->title);
wfree(fwin->title);
fwin->title = wstrdup(new_title);
+2 -2
View File
@@ -53,7 +53,7 @@ WCreateGeometryView(WMScreen *scr)
gview->view = W_CreateTopView(scr);
if (!gview->view) {
free(gview);
wfree(gview);
return NULL;
}
@@ -62,7 +62,7 @@ WCreateGeometryView(WMScreen *scr)
gview->font = WMSystemFontOfSize(scr, 12);
if (!gview->font) {
W_DestroyView(gview->view);
free(gview);
wfree(gview);
return NULL;
}
+3 -3
View File
@@ -212,7 +212,7 @@ wGNOMEUpdateClientListHint(WScreen *scr)
XChangeProperty(dpy, scr->root_win, _XA_WIN_CLIENT_LIST, XA_CARDINAL, 32,
PropModeReplace, (unsigned char *)windows, count);
free(windows);
wfree(windows);
XFlush(dpy);
}
@@ -586,7 +586,7 @@ wGNOMERemoveClient(WWindow *wwin)
if (area) {
if (area->window == wwin->client_win) {
wwin->screen_ptr->reservedAreas = area->next;
free(area);
wfree(area);
flag = 1;
} else {
while (area->next && area->next->window != wwin->client_win)
@@ -596,7 +596,7 @@ wGNOMERemoveClient(WWindow *wwin)
WReservedArea *next;
next = area->next->next;
free(area->next);
wfree(area->next);
area->next = next;
flag = 1;
+12 -12
View File
@@ -276,13 +276,13 @@ wIconDestroy(WIcon *icon)
XFreePixmap(dpy, icon->pixmap);
if (icon->file)
free(icon->file);
wfree(icon->file);
if (icon->image!=NULL)
RDestroyImage(icon->image);
wCoreDestroy(icon->core);
free(icon);
wfree(icon);
}
@@ -451,7 +451,7 @@ wIconChangeImageFile(WIcon *icon, char *file)
}
if (path)
free(path);
wfree(path);
return !error;
}
@@ -486,8 +486,8 @@ getnameforicon(WWindow *wwin)
if (access(path, F_OK)!=0) {
if (mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR)) {
wsyserror(_("could not create directory %s"), path);
free(path);
free(suffix);
wfree(path);
wfree(suffix);
return NULL;
}
}
@@ -495,8 +495,8 @@ getnameforicon(WWindow *wwin)
if (access(path, F_OK)!=0) {
if (mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR)!=0) {
wsyserror(_("could not create directory %s"), path);
free(path);
free(suffix);
wfree(path);
wfree(suffix);
return NULL;
}
}
@@ -504,7 +504,7 @@ getnameforicon(WWindow *wwin)
strcat(path, "/");
strcat(path, suffix);
strcat(path, ".xpm");
free(suffix);
wfree(suffix);
return path;
}
@@ -539,12 +539,12 @@ wIconStore(WIcon *icon)
(wwin->wm_hints->flags & IconMaskHint)
? wwin->wm_hints->icon_mask : None);
if (!image) {
free(path);
wfree(path);
return NULL;
}
if (!RSaveImage(image, path, "XPM")) {
free(path);
wfree(path);
path = NULL;
}
RDestroyImage(image);
@@ -770,7 +770,7 @@ wIconUpdate(WIcon *icon)
wwarning(_("could not load default icon \"%s\":%s"),
file, RMessageForError(RErrorCode));
}
free(path);
wfree(path);
}
make_icons:
@@ -835,7 +835,7 @@ wIconPaint(WIcon *icon)
WMDrawString(scr->wmscreen, icon->core->window, gc,
scr->icon_title_font, x, 1, tmp, l);
free(tmp);
wfree(tmp);
}
if (icon->selected)
+10 -10
View File
@@ -427,7 +427,7 @@ removeModule(WScreen *scr, Window window)
if (KWMModules->title)
XFree(KWMModules->title);
#endif
free(KWMModules);
wfree(KWMModules);
KWMModules = next;
} else {
KWMModuleList *ptr;
@@ -441,7 +441,7 @@ removeModule(WScreen *scr, Window window)
if (ptr->next->title)
XFree(ptr->next->title);
#endif
free(ptr->next);
wfree(ptr->next);
ptr->next->next = next;
break;
}
@@ -496,7 +496,7 @@ removeDockWindow(WScreen *scr, Window window)
window);
next = KWMDockWindows->next;
free(KWMDockWindows);
wfree(KWMDockWindows);
KWMDockWindows = next;
} else {
@@ -508,7 +508,7 @@ removeDockWindow(WScreen *scr, Window window)
sendClientMessage(scr, scr->kwm_dock,
_XA_KWM_MODULE_DOCKWIN_REMOVE, window);
next = ptr->next->next;
free(ptr->next);
wfree(ptr->next);
ptr->next = next;
return;
}
@@ -1078,7 +1078,7 @@ performCommand(WScreen *scr, char *command, XClientMessageEvent *event)
cmd = ExpandOptions(scr, _("%a(Run Command,Type the command to run:)"));
if (cmd) {
ExecuteShellCommand(scr, cmd);
free(cmd);
wfree(cmd);
}
} else if (strcmp(command, "logout")==0) {
@@ -1394,7 +1394,7 @@ wKWMManageableClient(WScreen *scr, Window win, char *title)
*/
if (ptr && strncmp(ptr->title, title, strlen(ptr->title))==0) {
next = ptr->next;
free(ptr);
wfree(ptr);
KWMDoNotManageCrap = next;
#ifdef DEBUG1
printf("window %s not managed per KDE request\n", title);
@@ -1411,7 +1411,7 @@ wKWMManageableClient(WScreen *scr, Window win, char *title)
printf("window %s not managed per KDE request\n", title);
#endif
next = ptr->next->next;
free(ptr->next);
wfree(ptr->next);
ptr->next = next;
sendToModules(scr, _XA_KWM_MODULE_WIN_ADD, NULL, win);
@@ -1717,11 +1717,11 @@ connectKFM(WScreen *scr)
}
ptr = path;
path = wstrappend(ptr, buffer);
free(ptr);
wfree(ptr);
/* pid file */
f = fopen(path, "r");
free(path);
wfree(path);
if (!f)
return -1;
@@ -1764,7 +1764,7 @@ connectKFM(WScreen *scr)
ptr = wstrappend("auth", buffer);
writeSocket(sock, ptr);
free(ptr);
wfree(ptr);
return sock;
}
+8 -8
View File
@@ -252,15 +252,15 @@ shellCommandHandler(pid_t pid, unsigned char status, _tuple *data)
buffer = wstrappend(_("Could not execute command: "), data->command);
wMessageDialog(data->scr, _("Error"), buffer, _("OK"), NULL, NULL);
free(buffer);
wfree(buffer);
} else if (status != 127) {
/*
printf("%s: %i\n", data->command, status);
*/
}
free(data->command);
free(data);
wfree(data->command);
wfree(data);
}
@@ -456,7 +456,7 @@ check_defaults()
exit(1);
}
free(path);
wfree(path);
}
@@ -467,7 +467,7 @@ execInitScript()
char *paths = wstrappend(wusergnusteppath(), ":"DEF_CONFIG_PATHS);
file = wfindfile(paths, DEF_INIT_SCRIPT);
free(paths);
wfree(paths);
if (file) {
if (system(file) != 0) {
@@ -480,7 +480,7 @@ execInitScript()
exit(1);
}
#endif
free(file);
wfree(file);
}
}
@@ -492,7 +492,7 @@ ExecExitScript()
char *paths = wstrappend(wusergnusteppath(), ":"DEF_CONFIG_PATHS);
file = wfindfile(paths, DEF_EXIT_SCRIPT);
free(paths);
wfree(paths);
if (file) {
if (system(file) != 0) {
@@ -505,7 +505,7 @@ ExecExitScript()
exit(1);
}
#endif
free(file);
wfree(file);
}
}
+11 -11
View File
@@ -417,15 +417,15 @@ wMenuRemoveItem(WMenu *menu, int index)
/* destroy unshared data */
if (menu->entries[index]->text)
free(menu->entries[index]->text);
wfree(menu->entries[index]->text);
if (menu->entries[index]->rtext)
free(menu->entries[index]->rtext);
wfree(menu->entries[index]->rtext);
if (menu->entries[index]->free_cdata && menu->entries[index]->clientdata)
(*menu->entries[index]->free_cdata)(menu->entries[index]->clientdata);
free(menu->entries[index]);
wfree(menu->entries[index]);
for (i=index; i<menu->entry_no-1; i++) {
menu->entries[i+1]->order--;
@@ -628,10 +628,10 @@ wMenuDestroy(WMenu *menu, int recurse)
if (!menu->flags.brother) {
for (i=0; i<menu->entry_no; i++) {
free(menu->entries[i]->text);
wfree(menu->entries[i]->text);
if (menu->entries[i]->rtext)
free(menu->entries[i]->rtext);
wfree(menu->entries[i]->rtext);
#ifdef USER_MENU
if (menu->entries[i]->instances){
@@ -642,7 +642,7 @@ wMenuDestroy(WMenu *menu, int recurse)
if (menu->entries[i]->free_cdata && menu->entries[i]->clientdata) {
(*menu->entries[i]->free_cdata)(menu->entries[i]->clientdata);
}
free(menu->entries[i]);
wfree(menu->entries[i]);
}
if (recurse) {
@@ -657,14 +657,14 @@ wMenuDestroy(WMenu *menu, int recurse)
}
if (menu->entries)
free(menu->entries);
wfree(menu->entries);
}
FREE_PIXMAP(menu->menu_texture_data);
if (menu->cascades)
free(menu->cascades);
wfree(menu->cascades);
wCoreDestroy(menu->menu);
wFrameWindowDestroy(menu->frame);
@@ -673,7 +673,7 @@ wMenuDestroy(WMenu *menu, int recurse)
if (!menu->flags.brother && menu->brother)
wMenuDestroy(menu->brother, False);
free(menu);
wfree(menu);
}
@@ -1301,7 +1301,7 @@ editEntry(WMenu *menu, WMenuEntry *entry)
/* if !t, the user has canceled editing */
if (t) {
if (entry->text)
free(entry->text);
wfree(entry->text);
entry->text = wstrdup(t);
menu->flags.realized = 0;
@@ -1777,7 +1777,7 @@ _leaving(_delay *dl)
wMenuMove(dl->menu, dl->ox, dl->oy, True);
dl->menu->jump_back=NULL;
dl->menu->menu->screen_ptr->flags.jump_back_pending = 0;
free(dl);
wfree(dl);
}
+10 -10
View File
@@ -182,13 +182,13 @@ static Bool pl_nextCommand(WRootMenuData *data,
static void pl_closeMenuFile(WRootMenuData *data)
{
if (data->submenu)
free(data->submenu);
wfree(data->submenu);
if (data->curSubIndex)
free(data->curSubIndex);
wfree(data->curSubIndex);
PLRelease(data->pl);
free(data);
wfree(data);
}
@@ -257,12 +257,12 @@ static WRootMenuData *dir_openMenuFile(char *paths, time_t *timestamp)
}
tmp = wexpandpath(dirs[i]);
free(dirs[i]);
wfree(dirs[i]);
dirs[i] = tmp;
if (stat(dirs[i], &stat_buf)<0) {
wsyserror(_("%s:could not stat menu"), dirs[i]);
free(dirs[i]);
wfree(dirs[i]);
dirs[i] = NULL;
} else {
c++;
@@ -277,9 +277,9 @@ static WRootMenuData *dir_openMenuFile(char *paths, time_t *timestamp)
if (c == 0) {
for (i = 0; i < dirN; i++) {
if (dirs[i])
free(dirs[i]);
wfree(dirs[i]);
}
free(dirs);
wfree(dirs);
return NULL;
}
@@ -422,16 +422,16 @@ WRootMenuData *ReopenRootMenu(time_t *checkTime,
if (!path) {
wwarning(_("could not find any usable menu files. Please check '%s'"),
tmp);
free(tmp);
wfree(tmp);
return NULL;
}
free(tmp);
wfree(tmp);
if (*menuPath) {
if (strcmp(*menuPath, path) != 0) {
*menuTimestamp = 0;
free(*menuPath);
wfree(*menuPath);
*menuPath = path;
if (menu_is_default) {
+11 -11
View File
@@ -164,7 +164,7 @@ MakeCPPArgs(char *path)
*buf = 0; /* trunc filename */
putdef(line, " -I", tmp);
}
free(tmp);
wfree(tmp);
}
@@ -939,7 +939,7 @@ ExpandOptions(WScreen *scr, char *cmdline)
return out;
error:
free(out);
wfree(out);
if (selection)
XFree(selection);
return NULL;
@@ -1030,7 +1030,7 @@ appendrealloc(char *a, char *b)
return wstrdup(b);
else {
char *c = wstrappend(a, b);
free(a);
wfree(a);
return c;
}
}
@@ -1095,7 +1095,7 @@ GetShortcutString(char *text)
puts(tmp);
buffer = wstrappend(buffer, tmp);
*/
free(tmp);
wfree(tmp);
return buffer;
}
@@ -1143,14 +1143,14 @@ EscapeWM_CLASS(char *name, char *class)
if (ename && eclass) {
ret = wmalloc(strlen(ename)+strlen(eclass)+4);
sprintf(ret, "%s.%s", ename, eclass);
free(ename);
free(eclass);
wfree(ename);
wfree(eclass);
} else if (ename) {
ret = wstrdup(ename);
free(ename);
wfree(ename);
} else {
ret = wstrdup(eclass);
free(eclass);
wfree(eclass);
}
return ret;
@@ -1218,11 +1218,11 @@ UnescapeWM_CLASS(char *str, char **name, char **class)
(*class)[k] = 0;
if (!*name) {
free(*name);
wfree(*name);
*name = NULL;
}
if (!*class) {
free(*class);
wfree(*class);
*class = NULL;
}
}
@@ -1259,5 +1259,5 @@ SendHelperMessage(WScreen *scr, char type, int workspace, char *msg)
if (write(scr->helper_fd, buffer, len+4) < 0) {
wsyserror(_("could not send message to background image helper"));
}
free(buffer);
wfree(buffer);
}
+4 -4
View File
@@ -706,13 +706,13 @@ static void
freeMoveData(MoveData *data)
{
if (data->topList)
free(data->topList);
wfree(data->topList);
if (data->leftList)
free(data->leftList);
wfree(data->leftList);
if (data->rightList)
free(data->rightList);
wfree(data->rightList);
if (data->bottomList)
free(data->bottomList);
wfree(data->bottomList);
}
+4 -4
View File
@@ -94,7 +94,7 @@ wPixmapCreateFromXBMData(WScreen *scr, char *data, char *mask,
pix->image = XCreatePixmapFromBitmapData(dpy, scr->w_win, data, width,
height, fg, bg, scr->w_depth);
if (pix->image==None) {
free(pix);
wfree(pix);
return NULL;
}
if (mask) {
@@ -186,7 +186,7 @@ wPixmapCreate(WScreen *scr, Pixmap image, Pixmap mask)
if (!XGetGeometry(dpy, image, &foo, &bar, &bar, &width, &height, &baz,
&depth)) {
wwarning("XGetGeometry() failed during wPixmapCreate()");
free(pix);
wfree(pix);
return NULL;
}
pix->width = width;
@@ -225,7 +225,7 @@ wPixmapLoadXBMFile(WScreen *scr, char *path, char *mask_path)
if (XReadBitmapFile(dpy, scr->w_win, path, (unsigned *)&(pix->width),
(unsigned *)&(pix->height),
&(pix->image), &junk, &junk)!=BitmapSuccess) {
free(pix);
wfree(pix);
return NULL;
}
if (mask_path!=NULL) {
@@ -266,6 +266,6 @@ wPixmapDestroy(WPixmap *pix)
XFreePixmap(dpy, pix->image);
}
}
free(pix);
wfree(pix);
}
+1 -1
View File
@@ -247,7 +247,7 @@ PlaceIcon(WScreen *scr, int *x_ret, int *y_ret)
break;
}
free(map);
wfree(map);
}
+5 -5
View File
@@ -77,7 +77,7 @@ wPluginCreateFunction(int type, char *library_name,
function->handle = dlopen(library_name, RTLD_LAZY);
if (!function->handle) {
wwarning(_("library \"%s\" cound not be opened."), library_name);
free(function);
wfree(function);
return NULL;
}
@@ -85,7 +85,7 @@ wPluginCreateFunction(int type, char *library_name,
if (!function->proc.any) {
wwarning(_("function \"%s\" not found in library \"%s\""), proc_name, library_name);
dlclose(function->handle);
free(function);
wfree(function);
return NULL;
}
@@ -95,7 +95,7 @@ wPluginCreateFunction(int type, char *library_name,
wwarning(_("function \"%s\" not found in library \"%s\""), free_data_proc_name, library_name);
/*
dlclose(function->handle);
free(function);
wfree(function);
return NULL;
*/
}
@@ -128,11 +128,11 @@ wPluginDestroyFunction(WFunction *function)
if (function->freeData) {
function->freeData(&function->data);
} else {
free(function->data);
wfree(function->data);
}
}
if (function->arg) PLRelease(function->arg);
free(function);
wfree(function);
return;
}
+1 -1
View File
@@ -250,7 +250,7 @@ PropSetIconTileHint(WScreen *scr, RImage *image)
XChangeProperty(dpy, scr->info_window, _XA_WINDOWMAKER_ICON_TILE,
imageAtom, 8, PropModeReplace, tmp,
image->width * image->height * 4 + 4);
free(tmp);
wfree(tmp);
}
+3 -3
View File
@@ -192,7 +192,7 @@ get_qstring(FILE *f)
else {
char *tmp = unescapestr(buffer);
proplist_t pl = PLMakeString(tmp);
free(tmp);
wfree(tmp);
return pl;
}
}
@@ -224,7 +224,7 @@ get_string(FILE *f)
else {
char *tmp = unescapestr(buffer);
proplist_t pl = PLMakeString(tmp);
free(tmp);
wfree(tmp);
return pl;
}
}
@@ -473,7 +473,7 @@ ReadProplistFromFile(char *file)
pl = NULL;
}
free(buffer);
wfree(buffer);
fclose(f);
+26 -26
View File
@@ -165,7 +165,7 @@ execCommand(WMenu *menu, WMenuEntry *entry)
if (cmdline) {
ExecuteShellCommand(menu->frame->screen_ptr, cmdline);
free(cmdline);
wfree(cmdline);
}
XUngrabPointer(dpy, CurrentTime);
XSync(dpy, 0);
@@ -455,7 +455,7 @@ removeShortcutsForMenu(WMenu *menu)
while (ptr!=NULL) {
tmp = ptr->next;
if (ptr->menu == menu) {
free(ptr);
wfree(ptr);
} else {
ptr->next = newList;
newList = ptr;
@@ -490,7 +490,7 @@ addShortcut(char *file, char *shortcutDefinition, WMenu *menu,
mod = wXModifierFromKey(b);
if (mod<0) {
wwarning(_("%s:invalid key modifier \"%s\""), file, b);
free(ptr);
wfree(ptr);
return False;
}
ptr->modifier |= mod;
@@ -504,7 +504,7 @@ addShortcut(char *file, char *shortcutDefinition, WMenu *menu,
if (ksym==NoSymbol) {
wwarning(_("%s:invalid kbd shortcut specification \"%s\" for entry %s"),
file, shortcutDefinition, entry->text);
free(ptr);
wfree(ptr);
return False;
}
@@ -512,7 +512,7 @@ addShortcut(char *file, char *shortcutDefinition, WMenu *menu,
if (ptr->keycode==0) {
wwarning(_("%s:invalid key in shortcut \"%s\" for entry %s"), file,
shortcutDefinition, entry->text);
free(ptr);
wfree(ptr);
return False;
}
@@ -677,10 +677,10 @@ constructMenu(WMenu *menu, WMenuEntry *entry)
}
tmp = wexpandpath(path[i]);
free(path[i]);
wfree(path[i]);
lpath = getLocalizedMenuFile(tmp);
if (lpath) {
free(tmp);
wfree(tmp);
path[i] = lpath;
lpath = NULL;
} else {
@@ -741,10 +741,10 @@ constructMenu(WMenu *menu, WMenuEntry *entry)
finish:
i = 0;
while (path[i]!=NULL)
free(path[i++]);
free(path);
wfree(path[i++]);
wfree(path);
if (cmd)
free(cmd);
wfree(cmd);
}
@@ -1105,7 +1105,7 @@ readMenuFile(WScreen *scr, char *file_name)
wwarning(_("could not make arguments for menu file preprocessor"));
} else {
sprintf(command, "%s %s %s", CPP_PATH, args, file_name);
free(args);
wfree(args);
file = popen(command, "r");
if (!file) {
wsyserror(_("%s:could not open/preprocess menu file"),
@@ -1205,7 +1205,7 @@ readMenuPipe(WScreen *scr, char **file_name)
} else {
sprintf(command, "%s | %s %s", filename, CPP_PATH, args);
free(args);
wfree(args);
file = popen(command, "r");
if (!file) {
wsyserror(_("%s:could not open/preprocess menu file"), filename);
@@ -1382,7 +1382,7 @@ readMenuDirectory(WScreen *scr, char *title, char **path, char *command)
}
}
}
free(buffer);
wfree(buffer);
}
closedir(dir);
@@ -1440,10 +1440,10 @@ readMenuDirectory(WScreen *scr, char *title, char **path, char *command)
addMenuEntry(menu, d->name, NULL, "OPEN_MENU", buffer, path[d->index]);
free(buffer);
wfree(buffer);
if (d->name)
free(d->name);
free(d);
wfree(d->name);
wfree(d);
}
for (i = 0; i < WMGetBagItemCount(files); i++) {
@@ -1490,10 +1490,10 @@ readMenuDirectory(WScreen *scr, char *title, char **path, char *command)
}
addMenuEntry(menu, f->name, NULL, "SHEXEC", buffer, path[f->index]);
free(buffer);
wfree(buffer);
if (f->name)
free(f->name);
free(f);
wfree(f->name);
wfree(f);
}
WMFreeBag(files);
@@ -1561,14 +1561,14 @@ configureMenu(WScreen *scr, proplist_t definition)
if (!path) {
wsyserror(_("could not find menu file \"%s\" referenced in WMRootMenu"),
tmp);
free(tmp);
wfree(tmp);
return NULL;
}
if (stat(path, &stat_buf)<0) {
wsyserror(_("could not access menu \"%s\" referenced in WMRootMenu"), path);
free(path);
free(tmp);
wfree(path);
wfree(tmp);
return NULL;
}
@@ -1587,8 +1587,8 @@ configureMenu(WScreen *scr, proplist_t definition)
} else {
menu = NULL;
}
free(path);
free(tmp);
wfree(path);
wfree(tmp);
return menu;
}
@@ -1602,7 +1602,7 @@ configureMenu(WScreen *scr, proplist_t definition)
tmp = PLGetDescription(elem);
wwarning(_("%s:format error in root menu configuration \"%s\""),
"WMRootMenu", tmp);
free(tmp);
wfree(tmp);
return NULL;
}
mtitle = PLGetString(elem);
@@ -1678,7 +1678,7 @@ configureMenu(WScreen *scr, proplist_t definition)
tmp = PLGetDescription(elem);
wwarning(_("%s:format error in root menu configuration \"%s\""),
"WMRootMenu", tmp);
free(tmp);
wfree(tmp);
}
return menu;
+5 -5
View File
@@ -672,7 +672,7 @@ wScreenInit(int screen_number)
#if 0
if (!aquireManagerSelection(scr)) {
free(scr);
wfree(scr);
return NULL;
}
@@ -703,7 +703,7 @@ wScreenInit(int screen_number)
XSetErrorHandler(oldHandler);
if (CantManageScreen) {
free(scr);
wfree(scr);
return NULL;
}
@@ -1029,13 +1029,13 @@ wScreenRestoreState(WScreen *scr)
path = wdefaultspathfordomain(buf);
}
scr->session_state = PLGetProplistWithPath(path);
free(path);
wfree(path);
if (!scr->session_state && wScreenCount>1) {
char buf[16];
sprintf(buf, "WMState.%i", scr->screen);
path = wdefaultspathfordomain(buf);
scr->session_state = PLGetProplistWithPath(path);
free(path);
wfree(path);
}
if (!wPreferences.flags.noclip) {
@@ -1144,7 +1144,7 @@ wScreenSaveState(WScreen *scr)
str = wdefaultspathfordomain(buf);
}
path = PLMakeString(str);
free(str);
wfree(str);
PLSetFilename(scr->session_state, path);
if (!PLSave(scr->session_state, YES)) {
wsyserror(_("could not save session state in %s"), PLGetString(path));
+10 -10
View File
@@ -302,7 +302,7 @@ makeWindowState(WWindow *wwin, WApplication *wapp)
if (instance) XFree(instance);
if (class) XFree(class);
if (command) free(command);
if (command) wfree(command);
return win_state;
}
@@ -404,8 +404,8 @@ execCommand(WScreen *scr, char *command, char *host)
exit(111);
}
while (argc > 0)
free(argv[--argc]);
free(argv);
wfree(argv[--argc]);
wfree(argv);
return pid;
}
@@ -557,11 +557,11 @@ wSessionRestoreState(WScreen *scr)
} else if ((pid = execCommand(scr, command, host)) > 0) {
wWindowAddSavedState(instance, class, command, pid, state);
} else {
free(state);
wfree(state);
}
if (instance) free(instance);
if (class) free(class);
if (instance) wfree(instance);
if (class) wfree(class);
}
/* clean up */
PLSetStringCmpHook(StringCompareHook);
@@ -1150,17 +1150,17 @@ fail:
SmcSaveYourselfDone(smc_conn, ok);
if (prop[0].vals)
free(prop[0].vals);
wfree(prop[0].vals);
if (prop[1].vals)
free(prop[1].vals);
wfree(prop[1].vals);
if (discardCmd)
free(discardCmd);
wfree(discardCmd);
if (!ok) {
remove(statefile);
}
if (statefile)
free(statefile);
wfree(statefile);
}
+2 -2
View File
@@ -135,7 +135,7 @@ CommitStacking(WScreen *scr)
if (i>=nwindows) {
puts("Internal inconsistency! window_count is incorrect!!!");
printf("window_count says %i windows\n", nwindows);
free(windows);
wfree(windows);
return;
}
#endif
@@ -144,7 +144,7 @@ CommitStacking(WScreen *scr)
}
}
XRestackWindows(dpy, windows, i);
free(windows);
wfree(windows);
#ifdef KWM_HINTS
wKWMBroadcastStacking(scr);
+1 -1
View File
@@ -930,7 +930,7 @@ StartUp(Bool defaultScreenOnly)
/* go to workspace where we were before restart */
if (ws_state) {
wWorkspaceForceChange(wScreen[j], ws_state->workspace);
free(ws_state);
wfree(ws_state);
} else {
wSessionRestoreLastWorkspace(wScreen[j]);
}
+3 -3
View File
@@ -204,7 +204,7 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
}
entry = wMenuInsertCallback(switchmenu, idx, t, focusWindow, wwin);
free(t);
wfree(t);
entry->flags.indicator = 1;
entry->rtext = wmalloc(MAX_WORKSPACENAME_WIDTH+8);
@@ -245,7 +245,7 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
case ACTION_CHANGE:
if (entry->text)
free(entry->text);
wfree(entry->text);
if (wwin->frame->title)
sprintf(title, "%s", wwin->frame->title);
@@ -289,7 +289,7 @@ UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action)
entry = wMenuInsertCallback(switchmenu, idx, t,
focusWindow, wwin);
free(t);
wfree(t);
entry->rtext = rt;
entry->flags.indicator = 1;
entry->flags.indicator_type = it;
+4 -4
View File
@@ -293,9 +293,9 @@ wTextDestroy( WTextInput *wtext )
XFreeGC( dpy, wtext->gc );
XFreeGC( dpy, wtext->regGC );
XFreeGC( dpy, wtext->invGC );
free( wtext->text.txt );
wfree( wtext->text.txt );
wCoreDestroy( wtext->core );
free( wtext );
wfree( wtext );
LEAVE("wTextDestroy");
}
@@ -444,7 +444,7 @@ wTextPutText( WTextInput *wtext, char *txt )
/* no memory leaks! free the old txt */
if( wtext->text.txt != NULL )
free( wtext->text.txt );
wfree( wtext->text.txt );
wtext->text.txt = (char *)wmalloc((length+1)*sizeof(char));
strcpy(wtext->text.txt, txt );
@@ -508,7 +508,7 @@ textInsert( WTextInput *wtext, char *txt )
wtext->text.startPos = sp+txtLen;
wtext->text.endPos = sp+txtLen;
free(wtext->text.txt);
wfree(wtext->text.txt);
wtext->text.txt = newTxt;
wtext->text.length = newLen-1;
}
+13 -13
View File
@@ -169,9 +169,9 @@ wTextureDestroy(WScreen *scr, WTexture *texture)
case WTEX_MVGRADIENT:
case WTEX_MDGRADIENT:
for (i=0; texture->mgradient.colors[i]!=NULL; i++) {
free(texture->mgradient.colors[i]);
wfree(texture->mgradient.colors[i]);
}
free(texture->mgradient.colors);
wfree(texture->mgradient.colors);
break;
case WTEX_THGRADIENT:
@@ -188,9 +188,9 @@ wTextureDestroy(WScreen *scr, WTexture *texture)
}
#endif
for (i = 0; i < texture->function.argc; i++) {
free(texture->function.argv[i]);
wfree(texture->function.argv[i]);
}
free(texture->function.argv);
wfree(texture->function.argv);
break;
#endif /* TEXTURE_PLUGIN */
}
@@ -208,7 +208,7 @@ wTextureDestroy(WScreen *scr, WTexture *texture)
XSetErrorHandler(oldhandler);
}
XFreeGC(dpy, texture->any.gc);
free(texture);
wfree(texture);
#undef CANFREE
}
@@ -334,10 +334,10 @@ wTextureMakePixmap(WScreen *scr, int style, char *pixmap_file, XColor *color)
if (!image) {
wwarning(_("could not load texture pixmap \"%s\":%s"), file,
RMessageForError(RErrorCode));
free(file);
wfree(file);
return NULL;
}
free(file);
wfree(file);
texture = wmalloc(sizeof(WTexture));
memset(texture, 0, sizeof(WTexture));
@@ -376,10 +376,10 @@ wTextureMakeTGradient(WScreen *scr, int style, RColor *from, RColor *to,
if (!image) {
wwarning(_("could not load texture pixmap \"%s\":%s"), file,
RMessageForError(RErrorCode));
free(file);
wfree(file);
return NULL;
}
free(file);
wfree(file);
texture = wmalloc(sizeof(WTexture));
memset(texture, 0, sizeof(WTexture));
@@ -435,8 +435,8 @@ wTextureMakeFunction(WScreen *scr, char *lib, char *func, int argc, char **argv)
texture->handle = dlopen(lib, RTLD_LAZY);
if (!texture->handle) {
wwarning(_("library \"%s\" cound not be opened."), lib);
free(argv);
free(texture);
wfree(argv);
wfree(texture);
return NULL;
}
@@ -444,9 +444,9 @@ wTextureMakeFunction(WScreen *scr, char *lib, char *func, int argc, char **argv)
texture->render = dlsym(texture->handle, func);
if (!texture->render) {
wwarning(_("function \"%s\" not found in library \"%s\""), func, lib);
free(argv);
wfree(argv);
dlclose(texture->handle);
free(texture);
wfree(texture);
return NULL;
}
# else
+7 -7
View File
@@ -128,8 +128,8 @@ static void
removeUserMenudata(void *menudata)
{
WUserMenuData *data = menudata;
if(data->key) free(data->key);
free(data);
if(data->key) wfree(data->key);
wfree(data);
}
@@ -156,7 +156,7 @@ convertShortcuts(WScreen *scr, proplist_t shortcut)
if (!data) return NULL;
data->key = wmalloc(sizeof(WShortKey)*keycount);
if (!data->key) {
free(data);
wfree(data);
return NULL;
}
@@ -196,8 +196,8 @@ keyover:
/* get key */
if (!j) {
puts("fatal j");
free(data->key);
free(data);
wfree(data->key);
wfree(data);
return NULL;
}
data->key_no = j;
@@ -360,7 +360,7 @@ wUserMenuGet(WScreen *scr, WWindow *wwin)
tmp=wmalloc(strlen(wwin->wm_instance)+strlen(wwin->wm_class)+7);
sprintf(tmp,"%s.%s.menu",wwin->wm_instance,wwin->wm_class);
path = wfindfile(DEF_USER_MENU_PATHS,tmp);
free(tmp);
wfree(tmp);
if (!path) return NULL;
@@ -368,7 +368,7 @@ wUserMenuGet(WScreen *scr, WWindow *wwin)
menu = readUserMenuFile(scr, path);
}
free(path);
wfree(path);
}
return menu;
}
+2 -2
View File
@@ -149,11 +149,11 @@ void
wCoreDestroy(WCoreWindow *core)
{
if (core->stacking) {
free(core->stacking);
wfree(core->stacking);
}
XDeleteContext(dpy, core->window, wWinContext);
XDestroyWindow(dpy, core->window);
free(core);
wfree(core);
}
+4 -4
View File
@@ -205,7 +205,7 @@ wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
char *buffer = NULL;
buffer = wmalloc(strlen(class)+strlen(instance)+4);
key1 = PLMakeString(strcat(strcat(strcpy(buffer,instance),"."),class));
free(buffer);
wfree(buffer);
} else
key1 = NULL;
@@ -345,7 +345,7 @@ get_generic_value(WScreen *scr, char *instance, char *class, proplist_t option,
dict = PLGetDictionaryEntry(WDWindowAttributes->dictionary, key);
PLRelease(key);
free(buffer);
wfree(buffer);
if (dict) {
value = PLGetDictionaryEntry(dict, option);
@@ -434,7 +434,7 @@ wDefaultGetImage(WScreen *scr, char *winstance, char *wclass)
if (!image) {
wwarning(_("error loading image file \"%s\""), path, RMessageForError(RErrorCode));
}
free(path);
wfree(path);
image = wIconValidateIconSize(scr, image);
@@ -510,7 +510,7 @@ wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file)
buffer = wmalloc(strlen(instance) + strlen(class) + 2);
strcat(strcat(strcpy(buffer, instance), "."), class);
key = PLMakeString(buffer);
free(buffer);
wfree(buffer);
} else if (instance) {
key = PLMakeString(instance);
} else if (class) {
+24 -24
View File
@@ -248,7 +248,7 @@ wWindowDestroy(WWindow *wwin)
XFree(wwin->wm_class);
if (wwin->wm_gnustep_attr)
free(wwin->wm_gnustep_attr);
wfree(wwin->wm_gnustep_attr);
if (wwin->cmap_windows)
XFree(wwin->cmap_windows);
@@ -880,7 +880,7 @@ wManageWindow(WScreen *scr, Window window)
}
}
if (wstate != NULL) {
free(wstate);
wfree(wstate);
}
}
@@ -2447,7 +2447,7 @@ wWindowSetShape(WWindow *wwin)
0, wwin->frame->top_width, urec, count,
ShapeSet, Unsorted);
XFlush(dpy);
free(urec);
wfree(urec);
return;
alt_code:
@@ -2656,7 +2656,7 @@ wWindowGetSavedState(Window win)
class, command);
#endif
if (command) free(command);
if (command) wfree(command);
if (instance) XFree(instance);
if (class) XFree(class);
@@ -2679,11 +2679,11 @@ wWindowDeleteSavedState(WMagicNumber id)
printf("Deleted WindowState with ID %p, for %s.%s : \"%s\"\n",
wstate, wstate->instance, wstate->class, wstate->command);
#endif
if (wstate->instance) free(wstate->instance);
if (wstate->class) free(wstate->class);
if (wstate->command) free(wstate->command);
free(wstate->state);
free(wstate);
if (wstate->instance) wfree(wstate->instance);
if (wstate->class) wfree(wstate->class);
if (wstate->command) wfree(wstate->command);
wfree(wstate->state);
wfree(wstate);
} else {
while (tmp->next) {
if (tmp->next==wstate) {
@@ -2692,11 +2692,11 @@ wWindowDeleteSavedState(WMagicNumber id)
printf("Deleted WindowState with ID %p, for %s.%s : \"%s\"\n",
wstate, wstate->instance, wstate->class, wstate->command);
#endif
if (wstate->instance) free(wstate->instance);
if (wstate->class) free(wstate->class);
if (wstate->command) free(wstate->command);
free(wstate->state);
free(wstate);
if (wstate->instance) wfree(wstate->instance);
if (wstate->class) wfree(wstate->class);
if (wstate->command) wfree(wstate->command);
wfree(wstate->state);
wfree(wstate);
break;
}
tmp = tmp->next;
@@ -2721,11 +2721,11 @@ wWindowDeleteSavedStatesForPID(pid_t pid)
printf("Deleted WindowState with ID %p, for %s.%s : \"%s\"\n",
wstate, wstate->instance, wstate->class, wstate->command);
#endif
if (wstate->instance) free(wstate->instance);
if (wstate->class) free(wstate->class);
if (wstate->command) free(wstate->command);
free(wstate->state);
free(wstate);
if (wstate->instance) wfree(wstate->instance);
if (wstate->class) wfree(wstate->class);
if (wstate->command) wfree(wstate->command);
wfree(wstate->state);
wfree(wstate);
} else {
while (tmp->next) {
if (tmp->next->pid==pid) {
@@ -2735,11 +2735,11 @@ wWindowDeleteSavedStatesForPID(pid_t pid)
printf("Deleted WindowState with ID %p, for %s.%s : \"%s\"\n",
wstate, wstate->instance, wstate->class, wstate->command);
#endif
if (wstate->instance) free(wstate->instance);
if (wstate->class) free(wstate->class);
if (wstate->command) free(wstate->command);
free(wstate->state);
free(wstate);
if (wstate->instance) wfree(wstate->instance);
if (wstate->class) wfree(wstate->class);
if (wstate->command) wfree(wstate->command);
wfree(wstate->state);
wfree(wstate);
break;
}
tmp = tmp->next;
+11 -11
View File
@@ -245,7 +245,7 @@ updateWorkspaceMenu(WMenu *menu)
for (i=0; i<scr->workspace_count; i++) {
if (i < menu->entry_no) {
if (strcmp(menu->entries[i]->text,scr->workspaces[i]->name)!=0) {
free(menu->entries[i]->text);
wfree(menu->entries[i]->text);
strcpy(title, scr->workspaces[i]->name);
menu->entries[i]->text = wstrdup(title);
menu->flags.realized = 0;
@@ -296,7 +296,7 @@ updateMakeShortcutMenu(WMenu *menu, WWindow *wwin)
}
if (strcmp(buffer, entry->text)!=0) {
free(entry->text);
wfree(entry->text);
entry->text = wstrdup(buffer);
smenu->flags.realized = 0;
}
@@ -307,7 +307,7 @@ updateMakeShortcutMenu(WMenu *menu, WWindow *wwin)
if ((tmp = XKeysymToString(XKeycodeToKeysym(dpy, kcode, 0)))
&& (!entry->rtext || strcmp(tmp, entry->rtext)!=0)) {
if (entry->rtext)
free(entry->rtext);
wfree(entry->rtext);
entry->rtext = wstrdup(tmp);
smenu->flags.realized = 0;
}
@@ -315,14 +315,14 @@ updateMakeShortcutMenu(WMenu *menu, WWindow *wwin)
} else {
wMenuSetEnabled(smenu, i, False);
if (entry->rtext) {
free(entry->rtext);
wfree(entry->rtext);
entry->rtext = NULL;
smenu->flags.realized = 0;
}
}
entry->clientdata = wwin;
}
free(buffer);
wfree(buffer);
if (!smenu->flags.realized)
wMenuRealize(smenu);
}
@@ -643,9 +643,9 @@ OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard)
scr->window_menu = createWindowMenu(scr);
/* hack to save some memory allocation/deallocation */
free(scr->window_menu->entries[MC_MINIATURIZE]->text);
free(scr->window_menu->entries[MC_MAXIMIZE]->text);
free(scr->window_menu->entries[MC_SHADE]->text);
wfree(scr->window_menu->entries[MC_MINIATURIZE]->text);
wfree(scr->window_menu->entries[MC_MAXIMIZE]->text);
wfree(scr->window_menu->entries[MC_SHADE]->text);
} else {
updateWorkspaceMenu(scr->workspace_submenu);
}
@@ -683,9 +683,9 @@ OpenMiniwindowMenu(WWindow *wwin, int x, int y)
scr->window_menu = createWindowMenu(scr);
/* hack to save some memory allocation/deallocation */
free(scr->window_menu->entries[MC_MINIATURIZE]->text);
free(scr->window_menu->entries[MC_MAXIMIZE]->text);
free(scr->window_menu->entries[MC_SHADE]->text);
wfree(scr->window_menu->entries[MC_MINIATURIZE]->text);
wfree(scr->window_menu->entries[MC_MAXIMIZE]->text);
wfree(scr->window_menu->entries[MC_SHADE]->text);
} else {
updateWorkspaceMenu(scr->workspace_submenu);
}
+18 -18
View File
@@ -243,7 +243,7 @@ freeInspector(InspectorPanel *panel)
XDestroyWindow(dpy, panel->parent);
free(panel);
wfree(panel);
}
@@ -293,7 +293,7 @@ wDestroyInspectorPanels()
panel->inspected->flags.inspector_open = 0;
panel->inspected->inspector = NULL;
free(panel);
wfree(panel);
}
}
@@ -352,7 +352,7 @@ showIconFor(WMScreen *scrPtr, InspectorPanel *panel,
if ((flags & USE_TEXT_FIELD) != 0) {
file = WMGetTextFieldText(panel->fileText);
if (file && file[0] == 0) {
free(file);
wfree(file);
file = NULL;
}
} else {
@@ -382,13 +382,13 @@ showIconFor(WMScreen *scrPtr, InspectorPanel *panel,
file);
wMessageDialog(panel->frame->screen_ptr, _("Error"), buf,
_("OK"), NULL, NULL);
free(buf);
free(file);
wfree(buf);
wfree(file);
return -1;
}
pixmap = WMCreatePixmapFromFile(scrPtr, path);
free(path);
wfree(path);
if (!pixmap) {
char *buf;
@@ -398,11 +398,11 @@ showIconFor(WMScreen *scrPtr, InspectorPanel *panel,
file, RMessageForError(RErrorCode));
wMessageDialog(panel->frame->screen_ptr, _("Error"), buf,
_("OK"), NULL, NULL);
free(buf);
free(file);
wfree(buf);
wfree(file);
return -1;
}
free(file);
wfree(file);
}
WMSetLabelImage(panel->iconLbl, pixmap);
@@ -523,7 +523,7 @@ saveSettings(WMButton *button, InspectorPanel *panel)
buffer = wmalloc(strlen(wwin->wm_instance)+strlen(wwin->wm_class)+4);
strcat(strcat(strcpy(buffer, wwin->wm_instance), "."), wwin->wm_class);
key = PLMakeString(buffer);
free(buffer);
wfree(buffer);
} else if (WMGetButtonSelected(panel->defaultRb) != 0) {
key = PLRetain(AnyWindow);
flags = UPDATE_DEFAULTS;
@@ -563,7 +563,7 @@ saveSettings(WMButton *button, InspectorPanel *panel)
different |= insertAttribute(dict, winDic, AIcon, value, flags);
PLRelease(value);
}
free(icon_file);
wfree(icon_file);
}
{
@@ -689,7 +689,7 @@ saveSettings(WMButton *button, InspectorPanel *panel)
strcat(strcpy(buffer, wapp->main_window_desc->wm_instance), ".");
strcat(buffer, wapp->main_window_desc->wm_class);
key = PLMakeString(buffer);
free(buffer);
wfree(buffer);
iconFile = wDefaultGetIconFile(wwin->screen_ptr,
wapp->main_window_desc->wm_instance,
@@ -904,12 +904,12 @@ applySettings(WMButton *button, InspectorPanel *panel)
char *file = WMGetTextFieldText(panel->fileText);
if (file[0] == 0) {
free(file);
wfree(file);
file = NULL;
}
wIconChangeImageFile(wapp->app_icon->icon, file);
if (file)
free(file);
wfree(file);
wAppIconPaint(wapp->app_icon);
}
}
@@ -1075,7 +1075,7 @@ chooseIconCallback(WMWidget *self, void *clientData)
WMSetTextFieldText(panel->fileText, file);
showIconFor(WMWidgetScreen(self), panel, NULL, NULL,
USE_TEXT_FIELD);
free(file);
wfree(file);
}
WMSetButtonEnabled(panel->browseIconBtn, True);
} else {
@@ -1123,7 +1123,7 @@ selectSpecification(WMWidget *bPtr, void *data)
wFrameWindowChangeTitle(panel->frame->frame, str);
free(str);
wfree(str);
}
@@ -1273,8 +1273,8 @@ createInspectorForWindow(WWindow *wwin, int xpos, int ypos,
WMMoveWidget(panel->bothRb, 10, 18);
WMResizeWidget(panel->bothRb, frame_width - (2 * 10), 20);
WMSetButtonText(panel->bothRb, str);
free(tmp);
free(str);
wfree(tmp);
wfree(str);
WMGroupButtons(panel->defaultRb, panel->bothRb);
if (!selectedBtn)
+1 -1
View File
@@ -128,7 +128,7 @@ int wNotifyClear(Window window)
(int) clnt->not_win, clnt->not_mask );
#endif
wNotifyWindows = list_remove_elem( wNotifyWindows, clnt );
free( clnt );
wfree(clnt);
return True;
}
}
+12 -12
View File
@@ -124,7 +124,7 @@ wWorkspaceNew(WScreen *scr)
}
list[i] = wspace;
if (scr->workspaces)
free(scr->workspaces);
wfree(scr->workspaces);
scr->workspaces = list;
wWorkspaceMenuUpdate(scr, scr->workspace_menu);
@@ -181,11 +181,11 @@ wWorkspaceDelete(WScreen *scr, int workspace)
list[j++] = scr->workspaces[i];
else {
if (scr->workspaces[i]->name)
free(scr->workspaces[i]->name);
free(scr->workspaces[i]);
wfree(scr->workspaces[i]->name);
wfree(scr->workspaces[i]);
}
}
free(scr->workspaces);
wfree(scr->workspaces);
scr->workspaces = list;
scr->workspace_count--;
@@ -250,7 +250,7 @@ hideWorkpaceName(void *data)
if (scr->workspace_name_data) {
RDestroyImage(scr->workspace_name_data->back);
RDestroyImage(scr->workspace_name_data->text);
free(scr->workspace_name_data);
wfree(scr->workspace_name_data);
scr->workspace_name_data = NULL;
}
@@ -308,7 +308,7 @@ showWorkspaceName(WScreen *scr, int workspace)
if (scr->workspace_name_data) {
RDestroyImage(scr->workspace_name_data->back);
RDestroyImage(scr->workspace_name_data->text);
free(scr->workspace_name_data);
wfree(scr->workspace_name_data);
}
data = wmalloc(sizeof(WorkspaceNameData));
@@ -426,7 +426,7 @@ erro:
RDestroyImage(data->text);
if (data->back)
RDestroyImage(data->back);
free(data);
wfree(data);
scr->workspace_name_data = NULL;
@@ -810,19 +810,19 @@ wWorkspaceRename(WScreen *scr, int workspace, char *name)
buf[MAX_WORKSPACENAME_WIDTH] = 0;
/* update workspace */
free(scr->workspaces[workspace]->name);
wfree(scr->workspaces[workspace]->name);
scr->workspaces[workspace]->name = wstrdup(buf);
if (scr->clip_ws_menu) {
if (strcmp(scr->clip_ws_menu->entries[workspace+2]->text, buf)!=0) {
free(scr->clip_ws_menu->entries[workspace+2]->text);
wfree(scr->clip_ws_menu->entries[workspace+2]->text);
scr->clip_ws_menu->entries[workspace+2]->text = wstrdup(buf);
wMenuRealize(scr->clip_ws_menu);
}
}
if (scr->workspace_menu) {
if (strcmp(scr->workspace_menu->entries[workspace+2]->text, buf)!=0) {
free(scr->workspace_menu->entries[workspace+2]->text);
wfree(scr->workspace_menu->entries[workspace+2]->text);
scr->workspace_menu->entries[workspace+2]->text = wstrdup(buf);
wMenuRealize(scr->workspace_menu);
}
@@ -991,11 +991,11 @@ wWorkspaceRestoreState(WScreen *scr)
if (i >= scr->workspace_count)
wWorkspaceNew(scr);
if (scr->workspace_menu) {
free(scr->workspace_menu->entries[i+2]->text);
wfree(scr->workspace_menu->entries[i+2]->text);
scr->workspace_menu->entries[i+2]->text = wstrdup(PLGetString(pstr));
scr->workspace_menu->flags.realized = 0;
}
free(scr->workspaces[i]->name);
wfree(scr->workspaces[i]->name);
scr->workspaces[i]->name = wstrdup(PLGetString(pstr));
if (!wPreferences.flags.noclip) {
clip_state = PLGetDictionaryEntry(wks_state, dClip);
+3 -3
View File
@@ -154,7 +154,7 @@ wXDNDProcessSelection(XEvent *event)
/* final one */
WMPutInBag(items, wstrdup(retain));
total_size += strlen(retain) + 3;
free(retain);
wfree(retain);
/* now pack new string */
scr->xdestring = wmalloc(total_size);
@@ -170,7 +170,7 @@ wXDNDProcessSelection(XEvent *event)
/* unsupport object, still need more " ? tell ]d */
strcat(scr->xdestring, &tmp[5]);
}
free(tmp);
wfree(tmp);
}
WMFreeBag(items);
wDockReceiveDNDDrop(scr,event);
@@ -178,7 +178,7 @@ wXDNDProcessSelection(XEvent *event)
printf("free ");
puts(scr->xdestring);
*/
free(scr->xdestring); /* this xdestring is not from Xlib (no XFree) */
wfree(scr->xdestring); /* this xdestring is not from Xlib (no XFree) */
}
}