1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-04-26 19:01:25 +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
+2
View File
@@ -23,6 +23,8 @@ Changes since version 0.62.1:
- fixed some buffer overflow issues in WINGs
- fixed bug with WPrefs.app not selecting the menu appearance options after
startup.
- replaced free() with wfree() wherever appropriate
- fixed some memory leaks generated by wstrappend()
Changes since version 0.62.0:
+2 -2
View File
@@ -91,8 +91,8 @@ void
WMFreeArray(WMArray *array)
{
WMEmptyArray(array);
free(array->items);
free(array);
wfree(array->items);
wfree(array);
}
+7 -7
View File
@@ -497,7 +497,7 @@ WMRemoveFromBag(WMBag *self, void *item)
ptr = rbTreeDelete(self, ptr);
if (self->destructor)
self->destructor(ptr->data);
free(ptr);
wfree(ptr);
return 1;
} else {
@@ -518,7 +518,7 @@ WMEraseFromBag(WMBag *self, int index)
ptr = rbTreeDelete(self, ptr);
if (self->destructor)
self->destructor(ptr->data);
free(ptr);
wfree(ptr);
wassertrv(self->count == 0||self->root->index >= 0, 1);
@@ -548,7 +548,7 @@ WMDeleteFromBag(WMBag *self, int index)
ptr = rbTreeDelete(self, ptr);
if (self->destructor)
self->destructor(ptr->data);
free(ptr);
wfree(ptr);
wassertrv(self->count == 0||self->root->index >= 0, 1);
@@ -626,7 +626,7 @@ WMReplaceInBag(WMBag *self, int index, void *item)
ptr = rbTreeDelete(self, ptr);
if (self->destructor)
self->destructor(ptr->data);
free(ptr);
wfree(ptr);
} else if (ptr != self->nil) {
old = ptr->data;
ptr->data = item;
@@ -696,7 +696,7 @@ deleteTree(WMBag *self, W_Node *node)
deleteTree(self, node->right);
free(node);
wfree(node);
}
@@ -713,8 +713,8 @@ void
WMFreeBag(WMBag *self)
{
WMEmptyBag(self);
free(self->nil);
free(self);
wfree(self->nil);
wfree(self);
}
+2 -2
View File
@@ -92,7 +92,7 @@ W_ReadConfigurations(void)
buttonName = WMGetUDStringForKey(defaults, "MouseWheelUp");
if (buttonName) {
button = getButtonWithName(buttonName, Button4);
free(buttonName);
wfree(buttonName);
} else {
button = Button4;
}
@@ -101,7 +101,7 @@ W_ReadConfigurations(void)
buttonName = WMGetUDStringForKey(defaults, "MouseWheelDown");
if (buttonName) {
button = getButtonWithName(buttonName, Button5);
free(buttonName);
wfree(buttonName);
} else {
button = Button5;
}
+2 -2
View File
@@ -87,7 +87,7 @@ void
WMUnregisterViewDraggedTypes(WMView *view)
{
if (view->droppableTypes != NULL)
free(view->droppableTypes);
wfree(view->droppableTypes);
view->droppableTypes = NULL;
}
@@ -128,7 +128,7 @@ void
WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs)
{
if (view->dragDestinationProcs == NULL) {
free(view->dragDestinationProcs);
wfree(view->dragDestinationProcs);
view->dragDestinationProcs = wmalloc(sizeof(WMDragDestinationProcs));
}
*view->dragDestinationProcs = *procs;
+1 -1
View File
@@ -57,7 +57,7 @@ void
WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs)
{
if (view->dragSourceProcs)
free(view->dragSourceProcs);
wfree(view->dragSourceProcs);
view->dragSourceProcs = wmalloc(sizeof(WMDragSourceProcs));
*view->dragSourceProcs = *procs;
+3 -3
View File
@@ -74,7 +74,7 @@ wtokennext(char *word, char **next)
else
t = wstrdup(ret);
free(ret);
wfree(ret);
if (ctype==PRC_EOS)
*next = NULL;
@@ -151,8 +151,8 @@ wtokenjoin(char **list, int count)
void
wtokenfree(char **tokens, int count)
{
while (--count) free(tokens[count]);
free(tokens);
while (--count) wfree(tokens[count]);
wfree(tokens);
}
+1 -1
View File
@@ -282,7 +282,7 @@ drawTitleOfColumn(WMBrowser *bPtr, int column)
(bPtr->titleHeight-WMFontHeight(scr->boldFont))/2,
bPtr->columnSize.width, WACenter, WMColorGC(scr->white),
False, titleBuf, titleLen);
free (titleBuf);
wfree (titleBuf);
} else {
W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x,
(bPtr->titleHeight-WMFontHeight(scr->boldFont))/2,
+5 -7
View File
@@ -1261,7 +1261,7 @@ readConfiguration(W_ColorPanel *panel)
WMSetPopUpButtonItemEnabled(panel->customPaletteHistoryBtn,
item, perm_mask);
}
free(path);
wfree(path);
}
(void)closedir(dPtr);
}
@@ -3340,8 +3340,9 @@ customPaletteMenuRemove(W_ColorPanel *panel)
WMRemovePopUpButtonItem(panel->customPaletteHistoryBtn, item);
} else
} else {
wsyserror("Couldn't remove palette %s\n", tmp);
}
wfree(tmp);
}
@@ -3686,10 +3687,7 @@ generateNewFilename(char *curName)
ptr = curName;
if (
((ptr = strrchr(ptr, '{')) == 0) ||
sscanf(ptr, "{%i}%c", &n, &c) != 1
)
if (((ptr = strrchr(ptr, '{'))==0) || sscanf(ptr, "{%i}%c", &n, &c)!=1)
return wstrappend(curName, " {1}");
baseLen = ptr - curName -1;
@@ -3760,7 +3758,7 @@ ulongToRColor(WMScreen *scr, unsigned long value)
color.green = xcolor->green >> 8;
color.blue = xcolor->blue >> 8;
free(xcolor);
wfree(xcolor);
return color;
}
+1 -1
View File
@@ -324,7 +324,7 @@ fetchDragData(WMView *self, char *type)
data = WMCreateDataWithBytes(color, strlen(color)+1);
free(color);
wfree(color);
return data;
}
+4 -4
View File
@@ -50,9 +50,9 @@ generalize_xlfd (const char *xlfd)
"-*-*-*-*-*-*-%s-*-*-*-*-*-*-*,*",
xlfd, weight, slant, pxlsz, pxlsz);
free(pxlsz);
free(slant);
free(weight);
wfree(pxlsz);
wfree(slant);
wfree(weight);
return buf;
}
@@ -91,7 +91,7 @@ W_CreateFontSetWithGuess(Display *dpy, char *xlfd, char ***missing,
fs = XCreateFontSet(dpy, xlfd, missing, nmissing, def_string);
free(xlfd);
wfree(xlfd);
return fs;
}
+2 -2
View File
@@ -67,13 +67,13 @@ void
WMDestroyMenuItem(WMMenuItem *item)
{
if (item->title)
free(item->title);
wfree(item->title);
if (item->image)
WMReleasePixmap(item->image);
if (item->shortcutKey)
free(item->shortcutKey);
wfree(item->shortcutKey);
if (item->onStateImage)
WMReleasePixmap(item->onStateImage);
+1 -1
View File
@@ -429,7 +429,7 @@ WMCreateRuler(WMWidget * parent)
rPtr->view = W_CreateView(W_VIEW(parent));
if (!rPtr->view) {
free(rPtr);
wfree(rPtr);
return NULL;
}
+1 -1
View File
@@ -2878,7 +2878,7 @@ WMCreateTextForDocumentType(WMWidget *parent,
tPtr->view = W_CreateView(W_VIEW(parent));
if (!tPtr->view) {
perror("could not create text's view\n");
free(tPtr);
wfree(tPtr);
return NULL;
}
tPtr->view->self = tPtr;
+15 -15
View File
@@ -658,8 +658,8 @@ renderTexture(WMScreen *scr, proplist_t texture, int width, int height,
image = RRenderMultiGradient(width, height, colors, style);
for (i = 0; colors[i]!=NULL; i++)
free(colors[i]);
free(colors);
wfree(colors[i]);
wfree(colors);
}
} else if (strcasecmp(&type[1], "pixmap")==0) {
RImage *timage = NULL;
@@ -698,7 +698,7 @@ renderTexture(WMScreen *scr, proplist_t texture, int width, int height,
}
}
free(path);
wfree(path);
}
if (!image)
@@ -931,7 +931,7 @@ makeFileName(char *prefix)
while (access(fname, F_OK)==0) {
char buf[30];
free(fname);
wfree(fname);
sprintf(buf, "%08lx.cache", time(NULL));
fname = wstrappend(prefix, buf);
}
@@ -1000,7 +1000,7 @@ okEditTexture(void *data)
if (titem->current) {
name = GetTexturePanelTextureName(panel->texturePanel);
free(titem->title);
wfree(titem->title);
titem->title = name;
}
@@ -1013,7 +1013,7 @@ okEditTexture(void *data)
titem->ispixmap = isPixmap(prop);
free(titem->texture);
wfree(titem->texture);
titem->texture = str;
XFreePixmap(WMScreenDisplay(WMWidgetScreen(panel->texLs)), titem->preview);
@@ -1096,17 +1096,17 @@ deleteTexture(WMWidget *w, void *data)
titem2->selectedFor |= 1 << section;
}
free(titem->title);
free(titem->texture);
wfree(titem->title);
wfree(titem->texture);
PLRelease(titem->prop);
if (titem->path) {
if (remove(titem->path) < 0 && errno != ENOENT) {
wsyserror("could not remove file %s", titem->path);
}
free(titem->path);
wfree(titem->path);
}
free(titem);
wfree(titem);
WMRemoveListItem(panel->texLs, row);
WMSetButtonEnabled(panel->delB, False);
@@ -1133,7 +1133,7 @@ extractTexture(WMWidget *w, void *data)
OpenExtractPanelFor(panel, path);
free(path);
wfree(path);
}
}
@@ -1705,7 +1705,7 @@ createPanel(Panel *p)
}
if (ok) {
tmp = wstrappend(panel->fprefix, "/WPrefs/");
free(panel->fprefix);
wfree(panel->fprefix);
panel->fprefix = tmp;
if (access(panel->fprefix, F_OK)!=0) {
if (mkdir(panel->fprefix, 0755) < 0) {
@@ -1964,7 +1964,7 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
}
WMGroupButtons(panel->mstyB[0], panel->mstyB[1]);
@@ -2126,7 +2126,7 @@ storeData(_Panel *panel)
if (str) {
SetStringForKey(str, colorOptions[i*2]);
free(str);
wfree(str);
}
}
@@ -2195,7 +2195,7 @@ prepareForClose(_Panel *panel)
str = WMGetColorRGBDescription(color);
PLAppendArrayElement(textureList, PLMakeString(str));
free(str);
wfree(str);
}
WMSetUDObjectForKey(udb, textureList, "ColorList");
PLRelease(textureList);
+10 -10
View File
@@ -148,13 +148,13 @@ createImages(WMScreen *scr, RContext *rc, RImage *xis, char *file,
*icon1 = WMCreatePixmapFromFile(scr, path);
if (!*icon1) {
wwarning(_("could not load icon %s"), path);
free(path);
wfree(path);
return;
}
icon = RLoadImage(rc, path, 0);
if (!icon) {
wwarning(_("could not load icon %s"), path);
free(path);
wfree(path);
return;
}
RCombineImageWithColor(icon, &gray);
@@ -164,7 +164,7 @@ createImages(WMScreen *scr, RContext *rc, RImage *xis, char *file,
wwarning(_("could not process icon %s:"), file, RMessageForError(RErrorCode));
}
RDestroyImage(icon);
free(path);
wfree(path);
}
@@ -188,7 +188,7 @@ createPanel(Panel *p)
if (!xis) {
wwarning(_("could not load image file %s"), path);
}
free(path);
wfree(path);
}
panel->frame = WMCreateFrame(panel->win);
@@ -241,7 +241,7 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
path = LocateImage(buf2);
if (path) {
@@ -253,11 +253,11 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
}
free(buf1);
free(buf2);
wfree(buf1);
wfree(buf2);
WMMapSubwidgets(panel->icoF);
@@ -283,7 +283,7 @@ createPanel(Panel *p)
RImage *image, *scaled;
image = RLoadImage(WMScreenRContext(scr), path, 0);
free(path);
wfree(path);
scaled = RScaleImage(image, 61, 61);
icon = WMCreatePixmapFromRImage(scr, scaled, 128);
@@ -336,7 +336,7 @@ createPanel(Panel *p)
WMSetButtonImage(panel->oldsB, icon);
WMReleasePixmap(icon);
}
free(path);
wfree(path);
}
WMGroupButtons(panel->newsB, panel->oldsB);
+4 -4
View File
@@ -315,7 +315,7 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
path = LocateImage(buf2);
if (path) {
@@ -326,11 +326,11 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
}
free(buf1);
free(buf2);
wfree(buf1);
wfree(buf2);
panel->raisT = WMCreateTextField(panel->raisF);
WMResizeWidget(panel->raisT, 36, 20);
+9 -9
View File
@@ -191,12 +191,12 @@ captureClick(WMWidget *w, void *data)
WMSetTextFieldText(panel->shoT, shortcut);
if (row>=0) {
if (panel->shortcuts[row])
free(panel->shortcuts[row]);
wfree(panel->shortcuts[row]);
panel->shortcuts[row] = shortcut;
WMRedisplayWidget(panel->actLs);
} else {
free(shortcut);
wfree(shortcut);
}
}
}
@@ -218,7 +218,7 @@ clearShortcut(WMWidget *w, void *data)
if (row>=0) {
if (panel->shortcuts[row])
free(panel->shortcuts[row]);
wfree(panel->shortcuts[row]);
panel->shortcuts[row]=NULL;
WMRedisplayWidget(panel->actLs);
}
@@ -236,10 +236,10 @@ typedKeys(void *observerData, WMNotification *notification)
return;
if (panel->shortcuts[row])
free(panel->shortcuts[row]);
wfree(panel->shortcuts[row]);
panel->shortcuts[row] = WMGetTextFieldText(panel->shoT);
if (strlen(panel->shortcuts[row])==0) {
free(panel->shortcuts[row]);
wfree(panel->shortcuts[row]);
panel->shortcuts[row] = NULL;
}
WMRedisplayWidget(panel->actLs);
@@ -285,7 +285,7 @@ showData(_Panel *panel)
str = GetStringForKey(keyOptions[i]);
if (panel->shortcuts[i])
free(panel->shortcuts[i]);
wfree(panel->shortcuts[i]);
if (str)
panel->shortcuts[i] = trimstr(str);
else
@@ -294,7 +294,7 @@ showData(_Panel *panel)
if (panel->shortcuts[i] &&
(strcasecmp(panel->shortcuts[i], "none")==0
|| strlen(panel->shortcuts[i])==0)) {
free(panel->shortcuts[i]);
wfree(panel->shortcuts[i]);
panel->shortcuts[i] = NULL;
}
}
@@ -479,13 +479,13 @@ storeData(_Panel *panel)
if (panel->shortcuts[i]) {
str = trimstr(panel->shortcuts[i]);
if (strlen(str)==0) {
free(str);
wfree(str);
str = NULL;
}
}
if (str) {
SetStringForKey(str, keyOptions[i]);
free(str);
wfree(str);
} else {
SetStringForKey("None", keyOptions[i]);
}
+12 -12
View File
@@ -330,7 +330,7 @@ sgrabClicked(WMWidget *w, void *data)
if (shortcut) {
WMSetTextFieldText(panel->shortT, shortcut);
updateMenuItem(panel, panel->currentItem, panel->shortT);
free(shortcut);
wfree(shortcut);
}
}
panel->capturing = 0;
@@ -908,7 +908,7 @@ createPanel(_Panel *p)
static void
freeItemData(ItemData *data)
{
#define CFREE(d) if (d) free(d)
#define CFREE(d) if (d) wfree(d)
/* TODO */
switch (data->type) {
@@ -939,7 +939,7 @@ freeItemData(ItemData *data)
break;
}
free(data);
wfree(data);
#undef CFREE
}
@@ -1007,20 +1007,20 @@ parseCommand(proplist_t item)
data->param.directory.command = wstrdup(s);
wtokensplit(p, &tokens, &tokn);
free(p);
wfree(p);
ctokens = wmalloc(sizeof(char*)*tokn);
for (i = 0, j = 0; i < tokn; i++) {
if (strcmp(tokens[i], "-noext") == 0) {
free(tokens[i]);
wfree(tokens[i]);
data->param.directory.stripExt = 1;
} else {
ctokens[j++] = tokens[i];
}
}
data->param.directory.directory = wtokenjoin(ctokens, j);
free(ctokens);
wfree(ctokens);
wtokenfree(tokens, tokn);
} else {
@@ -1076,7 +1076,7 @@ parseCommand(proplist_t item)
return data;
error:
free(data);
wfree(data);
return NULL;
}
@@ -1120,7 +1120,7 @@ updateFrameTitle(_Panel *panel, char *title, InfoType type)
break;
}
WMSetFrameTitle(panel->optionsF, tmp);
free(tmp);
wfree(tmp);
} else {
WMSetFrameTitle(panel->optionsF, NULL);
}
@@ -1168,7 +1168,7 @@ updateMenuItem(_Panel *panel, WEditMenuItem *item, WMWidget *changedWidget)
assert(data != NULL);
#define REPLACE(v, d) if (v) free(v); v = d
#define REPLACE(v, d) if (v) wfree(v); v = d
switch (data->type) {
case ExecInfo:
@@ -1526,7 +1526,7 @@ getDefaultMenu(_Panel *panel)
}
}
free(menuPath);
wfree(menuPath);
if (menu) {
pmenu = menu;
@@ -1671,7 +1671,7 @@ processData(char *title, ItemData *data)
PLAppendArrayElement(item, pomenu);
s1 = wstrappend("| ", data->param.pipe.command);
PLAppendArrayElement(item, PLMakeString(s1));
free(s1);
wfree(s1);
break;
case ExternalInfo:
@@ -1697,7 +1697,7 @@ processData(char *title, ItemData *data)
data->param.directory.command);
PLAppendArrayElement(item, PLMakeString(tmp));
free(tmp);
wfree(tmp);
}
break;
+6 -6
View File
@@ -136,7 +136,7 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
path = LocateImage(buf2);
if (path) {
@@ -147,11 +147,11 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
}
free(buf1);
free(buf2);
wfree(buf1);
wfree(buf2);
WMMapSubwidgets(panel->scrF);
@@ -175,7 +175,7 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
panel->aliyB = WMCreateButton(panel->aliF, WBTOnOff);
WMResizeWidget(panel->aliyB, 48, 48);
@@ -190,7 +190,7 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
WMGroupButtons(panel->alinB, panel->aliyB);
+17 -16
View File
@@ -152,11 +152,11 @@ speedChange(WMWidget *w, void *data)
_("Error"),
_("Invalid mouse acceleration value. Must be a positive real value."),
_("OK"), NULL, NULL);
free(tmp);
wfree(tmp);
return;
}
panel->acceleration = accel;
free(tmp);
wfree(tmp);
} else {
i = (int)WMGetSliderValue(panel->speedS);
@@ -176,7 +176,7 @@ speedChange(WMWidget *w, void *data)
setMouseAccel(WMWidgetScreen(panel->win), panel->acceleration,
threshold);
}
free(tmp);
wfree(tmp);
}
@@ -432,17 +432,17 @@ fillModifierPopUp(WMPopUpButton *pop)
if (array[i] == NULL)
continue;
if (strstr(array[i], tmp)) {
free(array[i]);
wfree(array[i]);
array[i]=NULL;
break;
}
}
free(tmp);
wfree(tmp);
}
while (--a>0) {
if (array[a])
free(array[a]);
wfree(array[a]);
}
}
@@ -490,7 +490,7 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon %s"), path);
}
free(path);
wfree(path);
}
panel->speedS = WMCreateSlider(panel->speedF);
@@ -560,7 +560,7 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
path = LocateImage(buf2);
if (path) {
@@ -571,11 +571,11 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon file %s"), path);
}
free(path);
wfree(path);
}
}
free(buf1);
free(buf2);
wfree(buf1);
wfree(buf2);
panel->tester = CreateDoubleTest(panel->ddelaF, _("Test"));
WMResizeWidget(panel->tester, 84, 29);
@@ -711,6 +711,7 @@ storeCommandInScript(char *cmd, char *line)
fo = fopen(tmppath, "w");
if (!fo) {
wsyserror(_("could not create temporary file %s"), tmppath);
wfree(tmppath);
goto end;
}
@@ -743,13 +744,13 @@ storeCommandInScript(char *cmd, char *line)
if (rename(tmppath, path)!=0) {
wsyserror(_("could not rename file %s to %s\n"), tmppath, path);
}
free(tmppath);
wfree(tmppath);
}
sprintf(buffer, "chmod u+x %s", path);
system(buffer);
end:
free(path);
wfree(path);
if (f)
fclose(f);
}
@@ -767,7 +768,7 @@ storeData(_Panel *panel)
if (!WMGetUDBoolForKey(udb, "NoXSetStuff")) {
tmp = WMGetTextFieldText(panel->threT);
if (strlen(tmp)==0) {
free(tmp);
wfree(tmp);
tmp = wstrdup("4");
}
@@ -775,7 +776,7 @@ storeData(_Panel *panel)
10, tmp);
storeCommandInScript(XSET" m", buffer);
free(tmp);
wfree(tmp);
}
tmp = WMGetTextFieldText(panel->ddelaT);
@@ -801,7 +802,7 @@ storeData(_Panel *panel)
SetStringForKey(tmp, "ModifierKey");
free(tmp);
wfree(tmp);
}
+2 -2
View File
@@ -68,7 +68,7 @@ addPathToList(WMList *list, int index, char *path)
if (access(fpath, X_OK)!=0) {
item->uflags = 1;
}
free(fpath);
wfree(fpath);
}
@@ -171,7 +171,7 @@ browseForFile(WMWidget *w, void *data)
addPathToList(lPtr, i, str);
WMSetListBottomPosition(lPtr, WMGetListNumberOfRows(lPtr));
free(str);
wfree(str);
}
}
}
+24 -22
View File
@@ -193,7 +193,7 @@ updateGradButtons(TexturePanel *panel)
WMSetButtonImage(panel->dirdB, pixmap);
WMReleasePixmap(pixmap);
free(colors);
wfree(colors);
}
}
@@ -379,7 +379,7 @@ updateHueSlider(WMSlider *sPtr, WMFont *font, RHSVColor *hsv)
WMReleasePixmap(pixmap);
for (i = 0; i <= 6; i++)
free(colors[i]);
wfree(colors[i]);
}
@@ -446,7 +446,7 @@ sliderChangeCallback(WMWidget *w, void *data)
RConvertImage(WMScreenRContext(scr), image, &panel->gimage);
RDestroyImage(image);
free(colors);
wfree(colors);
WMRedisplayWidget(panel->gcolL);
@@ -554,7 +554,7 @@ gradDeleteCallback(WMWidget *w, void *data)
return;
item = WMGetListItem(panel->gcolL, row);
free(item->clientData);
wfree(item->clientData);
WMRemoveListItem(panel->gcolL, row);
@@ -610,6 +610,8 @@ updateImage(TexturePanel *panel, char *path)
if (!panel->image)
WMSetButtonEnabled(panel->okB, False);
wfree(message);
return;
}
@@ -663,7 +665,7 @@ browseImageCallback(WMWidget *w, void *data)
return;
fullpath = tmp;
free(ipath);
wfree(ipath);
ipath = fullpath;
path = wstrdup(fullpath);
@@ -676,20 +678,20 @@ browseImageCallback(WMWidget *w, void *data)
if (tmp) {
if (strcmp(fullpath, tmp)==0) {
free(path);
wfree(path);
path = tmp2;
}
free(tmp);
wfree(tmp);
}
if (!RGetImageFileFormat(fullpath)) {
WMRunAlertPanel(scr, panel->win, _("Error"),
_("The selected file does not contain a supported image."),
_("OK"), NULL, NULL);
free(path);
wfree(path);
} else {
updateImage(panel, fullpath);
free(panel->imageFile);
wfree(panel->imageFile);
panel->imageFile = path;
WMSetTextFieldText(panel->imageT, path);
@@ -891,7 +893,7 @@ SetTexturePanelTexture(TexturePanel *panel, char *name, proplist_t texture)
WMSetTextFieldText(panel->imageT,
PLGetString(PLGetArrayElement(texture, 1)));
if (panel->imageFile)
free(panel->imageFile);
wfree(panel->imageFile);
panel->imageFile = wstrdup(PLGetString(PLGetArrayElement(texture, 1)));
@@ -927,7 +929,7 @@ SetTexturePanelTexture(TexturePanel *panel, char *name, proplist_t texture)
PLGetString(PLGetArrayElement(texture, 1)));
if (panel->imageFile)
free(panel->imageFile);
wfree(panel->imageFile);
if ((panel->imageFile = wfindfileinarray(panel->pathList,
PLGetString(PLGetArrayElement(texture, 1)))) != NULL) {
@@ -946,7 +948,7 @@ SetTexturePanelTexture(TexturePanel *panel, char *name, proplist_t texture)
for (i = 0; i < WMGetListNumberOfRows(panel->gcolL); i++) {
item = WMGetListItem(panel->gcolL, i);
free(item->clientData);
wfree(item->clientData);
}
WMClearList(panel->gcolL);
@@ -1019,7 +1021,7 @@ SetTexturePanelTexture(TexturePanel *panel, char *name, proplist_t texture)
PLGetString(PLGetArrayElement(texture, 1)));
if (panel->imageFile)
free(panel->imageFile);
wfree(panel->imageFile);
panel->imageFile = wfindfileinarray(panel->pathList,
PLGetString(PLGetArrayElement(texture, 1)));
@@ -1055,7 +1057,7 @@ SetTexturePanelTexture(TexturePanel *panel, char *name, proplist_t texture)
bad_texture:
str = PLGetDescription(texture);
wwarning("error creating texture %s", str);
free(str);
wfree(str);
}
@@ -1087,7 +1089,7 @@ GetTexturePanelTexture(TexturePanel *panel)
str = WMGetColorRGBDescription(color);
prop = PLMakeArrayFromElements(PLMakeString("solid"),
PLMakeString(str), NULL);
free(str);
wfree(str);
break;
@@ -1117,7 +1119,7 @@ GetTexturePanelTexture(TexturePanel *panel)
PLMakeString(str), NULL);
break;
}
free(str);
wfree(str);
break;
case TYPE_TGRADIENT:
@@ -1148,8 +1150,8 @@ GetTexturePanelTexture(TexturePanel *panel)
PLMakeString(str),
PLMakeString(str2), NULL);
}
free(str);
free(str2);
wfree(str);
wfree(str2);
break;
@@ -1173,8 +1175,8 @@ GetTexturePanelTexture(TexturePanel *panel)
PLMakeString(str),
PLMakeString(str2), NULL);
}
free(str);
free(str2);
wfree(str);
wfree(str2);
break;
case TYPE_GRADIENT:
@@ -1191,7 +1193,7 @@ GetTexturePanelTexture(TexturePanel *panel)
prop = PLMakeArrayFromElements(PLMakeString("mhgradient"),
PLMakeString(str), NULL);
}
free(str);
wfree(str);
for (i = 0; i < WMGetListNumberOfRows(panel->gcolL); i++) {
RColor *rgb;
@@ -1608,7 +1610,7 @@ testOKButton(WMWidget *self, void *data)
XCopyArea(dpy, pix, win, (WMScreenRContext(WMWidgetScreen(panel->okB)))->copy_gc, 0, 0, image->width, image->height,
0, 0);
free (test);
wfree (test);
}
+7 -7
View File
@@ -443,7 +443,7 @@ LocateImage(char *name)
sprintf(tmp, "%s.xpm", name);
path = WMPathForResourceOfType(tmp, "xpm");
}
free(tmp);
wfree(tmp);
if (!path) {
wwarning(_("could not locate image file %s\n"), name);
}
@@ -584,7 +584,7 @@ SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, char *file,
WMReleasePixmap(icon);
if (iconPath)
free(iconPath);
wfree(iconPath);
}
@@ -618,7 +618,7 @@ AddSection(Panel *panel, char *iconFile)
}
SetButtonAlphaImage(WMWidgetScreen(bPtr), bPtr, iconFile,
t1, t2);
free(t1);
wfree(t1);
}
WMMapWidget(bPtr);
@@ -670,7 +670,7 @@ Initialize(WMScreen *scr)
WMReleasePixmap(icon);
}
}
free(path);
wfree(path);
}
memset(&WPrefs, 0, sizeof(_WPrefs));
@@ -753,7 +753,7 @@ loadConfigurations(WMScreen *scr, WMWindow *mainw)
path);
WMRunAlertPanel(scr, mainw, _("Error"), mbuf, _("OK"), NULL, NULL);
}
free(path);
wfree(path);
path = getenv("WMAKER_BIN_NAME");
if (!path)
@@ -763,7 +763,7 @@ loadConfigurations(WMScreen *scr, WMWindow *mainw)
command = wstrappend(path, " --version");
file = popen(command, "r");
free(command);
wfree(command);
}
if (!file || !fgets(buffer, 1023, file)) {
wsyserror(_("could not extract version information from Window Maker"));
@@ -804,7 +804,7 @@ loadConfigurations(WMScreen *scr, WMWindow *mainw)
command = wstrappend(path, " --global_defaults_path");
file = popen(command, "r");
free(command);
wfree(command);
}
if (!file || !fgets(buffer, 1023, file)) {
wsyserror(_("could not run \"%s --global_defaults_path\"."), path);
+2 -2
View File
@@ -330,7 +330,7 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon %s"), path);
}
free(path);
wfree(path);
}
path = LocateImage(OPAQUE_MOVE_PIXMAP);
@@ -342,7 +342,7 @@ createPanel(Panel *p)
} else {
wwarning(_("could not load icon %s"), path);
}
free(path);
wfree(path);
}
WMMapSubwidgets(panel->opaqF);
+7 -7
View File
@@ -163,7 +163,7 @@ createPanel(Panel *p)
if (!xis) {
wwarning(_("could not load image file %s"), path);
}
free(path);
wfree(path);
}
panel->frame = WMCreateFrame(panel->win);
@@ -194,7 +194,7 @@ createPanel(Panel *p)
WMSetLabelImage(panel->cyclL, icon1);
WMReleasePixmap(icon1);
}
free(path);
wfree(path);
}
/**/
@@ -216,7 +216,7 @@ createPanel(Panel *p)
WMSetLabelImage(panel->linkL, icon1);
WMReleasePixmap(icon1);
}
free(path);
wfree(path);
}
/**/
@@ -238,7 +238,7 @@ createPanel(Panel *p)
WMSetLabelImage(panel->newL, icon1);
WMReleasePixmap(icon1);
}
free(path);
wfree(path);
}
/**/
@@ -261,7 +261,7 @@ createPanel(Panel *p)
WMSetLabelImage(panel->posiL, icon1);
WMReleasePixmap(icon1);
}
free(path);
wfree(path);
}
panel->posP = WMCreatePopUpButton(panel->navF);
@@ -299,7 +299,7 @@ createPanel(Panel *p)
WMSetButtonAltImage(panel->dockB, icon1);
WMReleasePixmap(icon1);
}
free(path);
wfree(path);
}
WMSetBalloonTextForView(_("Disable/enable the application Dock (the\n"
"vertical icon bar in the side of the screen)."),
@@ -320,7 +320,7 @@ createPanel(Panel *p)
WMSetButtonAltImage(panel->clipB, icon1);
WMReleasePixmap(icon1);
}
free(path);
wfree(path);
}
WMSetBalloonTextForView(_("Disable/enable the Clip (that thing with\n"
"a paper clip icon)."),
+3 -3
View File
@@ -74,7 +74,7 @@ CreateDoubleTest(WMWidget *parent, char *text)
dPtr->view = W_CreateView(W_VIEW(parent));
if (!dPtr->view) {
free(dPtr);
wfree(dPtr);
return NULL;
}
/* always do this */
@@ -186,9 +186,9 @@ destroyDoubleTest(_DoubleTest *dPtr)
if (dPtr->timer)
WMDeleteTimerHandler(dPtr->timer);
if (dPtr->text)
free(dPtr->text);
wfree(dPtr->text);
free(dPtr);
wfree(dPtr);
}
+8 -8
View File
@@ -141,7 +141,7 @@ WCreateEditMenuItem(WMWidget *parent, char *title, Bool isTitle)
iPtr->view = W_CreateView(W_VIEW(parent));
if (!iPtr->view) {
free(iPtr);
wfree(iPtr);
return NULL;
}
iPtr->view->self = iPtr;
@@ -300,13 +300,13 @@ static void
destroyEditMenuItem(WEditMenuItem *iPtr)
{
if (iPtr->label)
free(iPtr->label);
wfree(iPtr->label);
if (iPtr->data && iPtr->destroyData)
(*iPtr->destroyData)(iPtr->data);
if (iPtr->submenu)
WMDestroyWidget(iPtr->submenu);
free(iPtr);
wfree(iPtr);
}
@@ -441,7 +441,7 @@ makeEditMenu(WMScreen *scr, WMWidget *parent, char *title)
mPtr->flags.standalone = 1;
}
if (!mPtr->view) {
free(mPtr);
wfree(mPtr);
return NULL;
}
mPtr->view->self = mPtr;
@@ -553,7 +553,7 @@ WSetEditMenuTitle(WEditMenu *mPtr, char *title)
item = WMGetFromBag(mPtr->items, 0);
free(item->label);
wfree(item->label);
item->label = wstrdup(title);
updateMenuContents(mPtr);
@@ -958,7 +958,7 @@ stopEditItem(WEditMenu *menu, Bool apply)
if (apply) {
text = WMGetTextFieldText(menu->tfield);
free(menu->selectedItem->label);
wfree(menu->selectedItem->label);
menu->selectedItem->label = wstrdup(text);
updateMenuContents(menu);
@@ -1548,9 +1548,9 @@ destroyEditMenu(WEditMenu *mPtr)
WMFreeBag(mPtr->items);
free(mPtr->tdelegate);
wfree(mPtr->tdelegate);
free(mPtr);
wfree(mPtr);
}
+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) */
}
}
+3 -3
View File
@@ -325,10 +325,10 @@ void closeWindow(WMWidget *w, void *d)
} else {
WMDeleteTimerHandler(data->tid);
WMDestroyWidget(w);
free(data->buffer);
free(data->rects);
wfree(data->buffer);
wfree(data->rects);
WMReleasePixmap(data->pixmap);
free(data);
wfree(data);
}
}
+22 -21
View File
@@ -111,7 +111,7 @@ loadImage(RContext *rc, char *file)
wwarning("%s:could not load image file used in texture:%s", path,
RMessageForError(RErrorCode));
}
free(path);
wfree(path);
return image;
}
@@ -268,8 +268,8 @@ parseTexture(RContext *rc, char *text)
wwarning("could not parse texture %s", text);
for (j = 0; colors[j]!=NULL; j++)
free(colors[j]);
free(colors);
wfree(colors[j]);
wfree(colors);
goto error;
}
tmp = PLGetString(val);
@@ -279,16 +279,16 @@ parseTexture(RContext *rc, char *text)
tmp, text);
for (j = 0; colors[j]!=NULL; j++)
free(colors[j]);
free(colors);
wfree(colors[j]);
wfree(colors);
goto error;
}
if (!(colors[i-2] = malloc(sizeof(RColor)))) {
wwarning("out of memory while parsing texture");
for (j = 0; colors[j]!=NULL; j++)
free(colors[j]);
free(colors);
wfree(colors[j]);
wfree(colors);
goto error;
}
@@ -320,8 +320,8 @@ parseTexture(RContext *rc, char *text)
image = RRenderMultiGradient(iwidth, iheight, colors, gtype);
for (j = 0; colors[j]!=NULL; j++)
free(colors[j]);
free(colors);
wfree(colors[j]);
wfree(colors);
if (!image) {
wwarning("could not render gradient texture:%s",
@@ -658,7 +658,7 @@ function_cleanup:
if (argv) {
int i;
for (i=0; i<argc; i++) {
free(argv[i]);
wfree(argv[i]);
}
}
if (handle) {
@@ -685,7 +685,7 @@ function_cleanup:
error:
if (texture)
free(texture);
wfree(texture);
if (texarray)
PLRelease(texarray);
@@ -708,8 +708,8 @@ freeTexture(BackgroundTexture *texture)
if (texture->pixmap) {
XFreePixmap(dpy, texture->pixmap);
}
free(texture->spec);
free(texture);
wfree(texture->spec);
wfree(texture);
}
@@ -980,7 +980,7 @@ helperLoop(RContext *rc)
printf("change pixmappath %s\n", &buffer[1]);
#endif
if (PixmapPath)
free(PixmapPath);
wfree(PixmapPath);
PixmapPath = wstrdup(&buffer[1]);
break;
@@ -1010,6 +1010,7 @@ updateDomain(char *domain, char *key, char *texture)
{
char *program = "wdwrite";
/* here is a mem leak */
system(wstrappend("wdwrite ",
wstrappend(domain, smooth ? " SmoothWorkspaceBack YES"
: " SmoothWorkspaceBack NO")));
@@ -1047,7 +1048,7 @@ getValueForKey(char *domain, char *keyName)
if (!d) {
wwarning("could not open domain file %s", path);
}
free(path);
wfree(path);
if (d && !PLIsDictionary(d)) {
PLRelease(d);
@@ -1066,7 +1067,7 @@ getValueForKey(char *domain, char *keyName)
d = NULL;
} else {
d = PLGetProplistWithPath(path);
free(path);
wfree(path);
}
if (d && !PLIsDictionary(d)) {
@@ -1155,21 +1156,21 @@ getFullPixmapPath(char *file)
char *path = wmalloc(bsize);
while (!getcwd(path, bsize)) {
free(path);
wfree(path);
bsize += bsize/2;
path = malloc(bsize);
}
tmp = wstrappend(path, "/");
free(path);
wfree(path);
path = wstrappend(tmp, file);
free(tmp);
wfree(tmp);
return path;
}
/* the file is in the PixmapPath */
free(tmp);
wfree(tmp);
return wstrdup(file);
}
@@ -1454,7 +1455,7 @@ main(int argc, char **argv)
char *image_path = getFullPixmapPath(image_name);
sprintf(buffer, "(%s, \"%s\", %s)", style, image_path, back_color);
free(image_path);
wfree(image_path);
texture = (char*)buffer;
}
+1 -1
View File
@@ -221,7 +221,7 @@ Bool checkDir(char *path, Bool fatal)
path, newName, wstrerror(errno));
}
}
free(newName);
wfree(newName);
return False;
}