This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.
The branch, next has been updated
via 1265873fa310aa42d42fdfad1483c5f66d304825 (commit)
via 1a64ca8275974592cfa3a42d4cbb0d4355031833 (commit)
via 68e4ccca58ee42733083164d52fd635fecce4a35 (commit)
via 788a51c1167fe760f905b865ea8830ac800b6653 (commit)
via e750f9307eef531060aa8c4d5ab8ca4f3311c894 (commit)
via a75699faefaa9b91ef78804e1b810f618ddf8825 (commit)
via bec027258431c1f6d32dafe9f49f57017ba380ff (commit)
via 32c8dc04ce40c72b19f11c90fddd2bd0329d9305 (commit)
via 4501d4c0786081fa27e4f0130bfed57547e52aa2 (commit)
via 659519f3065862a348d13f89ebb98db34cb4c056 (commit)
via c2a357fe1bd95c59c839e874decd83ca4607fc8b (commit)
via 3a68e974b65cf8b11d6352499e322c7bd7c7a25c (commit)
via fab73f47c71d851de7ff71533b17540dde5659b2 (commit)
via 99400735303826db7fa0ed1f836abc157cb965e6 (commit)
via 7d48855077703d3537aee39f16634cc06f2ec272 (commit)
via 9f2f94a17420b97d81d45bbab9764fb2716a3e12 (commit)
via 741243a792a379872543f1ad7989dad2c6fbd3fc (commit)
via bee02df72f1ff02fa11533f666d955511d9c3fbd (commit)
via d292c6208038d08f85f81f15ddbed12d42d57602 (commit)
via dc4df6455a2868577c04279af04bf4741e9b0d02 (commit)
via 4894e3fe4d03b92de1dd1e4ba2b037068960c0bf (commit)
via 43972d307ad232d926c250becc3ad80e866f1494 (commit)
via 7f840db1aa0882e81225b66ad18820a048f3d069 (commit)
from ca64091f05b2007c75d9cab876249b57fc4533e3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/1265873fa310aa42d42fdfad1483c5f66d304825
commit 1265873fa310aa42d42fdfad1483c5f66d304825
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:51 2014 +0200
WMaker: removed use of dangerous RETRY macro in GetCommandForPid for Linux
(Coverity #50267)
As pointed by Coverity, the function GetCommandForPid did use a macro
'RETRY' for the 'close' of file descriptor, which is not correct because
on success the function 'close' does not reset errno, and in case of
failure the file descriptor is not more valid anyway.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/osdep_linux.c b/src/osdep_linux.c
index 6d246e5c..bb1ef2e6 100644
--- a/src/osdep_linux.c
+++ b/src/osdep_linux.c
@@ -15,10 +15,6 @@
#include "osdep.h"
-#define RETRY( x ) do { -
x; - } while (errno
== EINTR);
-
/*
* copy argc and argv for an existing process identified by `pid'
* into suitable storage given in ***argv and *argc.
@@ -54,10 +50,10 @@ Bool GetCommandForPid(int pid, char ***argv, int *argc)
break;
if (errno == EINTR)
continue;
- RETRY( close(fd) )
+ close(fd);
return False;
}
- RETRY( close(fd) )
+ close(fd);
/* count args */
for (i = 0; i < count; i++)
http://repo.or.cz/w/wmaker-crm.git/commit/1a64ca8275974592cfa3a42d4cbb0d4355031833
commit 1a64ca8275974592cfa3a42d4cbb0d4355031833
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:50 2014 +0200
WMaker: change conceptually imperfect code in drawerDestroy (Coverity
#50265)
Factually, the program works because the function 'drawerRemoveFromChain'
uses only the address of the drawer and not the content of the structure,
but conceptually this address point to a storage space that has been
de-allocated, so that's calling for trouble for future code changes.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/dock.c b/src/dock.c
index 3fd3dbe1..8b93a506 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -4448,13 +4448,15 @@ static void drawerDestroy(WDock *drawer)
wAppIconDestroy(drawer->icon_array[0]);
wfree(drawer->icon_array);
- wfree(drawer);
+ drawer->icon_array = NULL;
drawerRemoveFromChain(scr, drawer);
if (scr->last_dock == drawer)
scr->last_dock = NULL;
if (scr->attracting_drawer == drawer)
scr->attracting_drawer = NULL;
+
+ wfree(drawer);
}
http://repo.or.cz/w/wmaker-crm.git/commit/68e4ccca58ee42733083164d52fd635fecce4a35
commit 68e4ccca58ee42733083164d52fd635fecce4a35
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:49 2014 +0200
WMaker: removed check that is always true in wDefaultsInitDomain (Coverity
#50243)
As pointed by Coverity, the function 'wdefaultspathfordomain' cannot
return a NULL path, so it is not necessary to check for it. (in the
present case, it led Coverity to think it was possible to have the
structure 'stbuf' uninitialised)
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/defaults.c b/src/defaults.c
index 436cb203..2f4626fe 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -889,7 +889,6 @@ WDDomain *wDefaultsInitDomain(const char *domain, Bool
requireDictionary)
WDDomain *db;
struct stat stbuf;
static int inited = 0;
- const char *the_path;
WMPropList *shared_dict = NULL;
if (!inited) {
@@ -900,15 +899,14 @@ WDDomain *wDefaultsInitDomain(const char *domain, Bool
requireDictionary)
db = wmalloc(sizeof(WDDomain));
db->domain_name = domain;
db->path = wdefaultspathfordomain(domain);
- the_path = db->path;
- if (the_path && stat(the_path, &stbuf) >= 0) {
- db->dictionary = WMReadPropListFromFile(the_path);
+ if (stat(db->path, &stbuf) >= 0) {
+ db->dictionary = WMReadPropListFromFile(db->path);
if (db->dictionary) {
if (requireDictionary &&
!WMIsPLDictionary(db->dictionary)) {
WMReleasePropList(db->dictionary);
db->dictionary = NULL;
- wwarning(_("Domain %s (%s) of defaults database
is corrupted!"), domain, the_path);
+ wwarning(_("Domain %s (%s) of defaults database
is corrupted!"), domain, db->path);
}
db->timestamp = stbuf.st_mtime;
} else {
http://repo.or.cz/w/wmaker-crm.git/commit/788a51c1167fe760f905b865ea8830ac800b6653
commit 788a51c1167fe760f905b865ea8830ac800b6653
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:48 2014 +0200
WMaker: fix memory leak in the window inspector when saving settings
(Coverity #50175)
As pointed by Coverity, there is one case where the string returned by
WMGetTextFieldText could be left allocated.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/winspector.c b/src/winspector.c
index 679c56f8..f1289ddd 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -488,11 +488,13 @@ static void saveSettings(WMWidget *button, void
*client_data)
/* The icon filename (if exists) */
icon_file = WMGetTextFieldText(panel->fileText);
- if ((icon_file) && (icon_file[0] != 0)) {
- value = WMCreatePLString(icon_file);
- different |= insertAttribute(dict, winDic, AIcon, value, flags);
- different2 |= insertAttribute(dict, appDic, AIcon, value,
flags);
- WMReleasePropList(value);
+ if (icon_file != NULL) {
+ if (icon_file[0] != '0') {
+ value = WMCreatePLString(icon_file);
+ different |= insertAttribute(dict, winDic, AIcon,
value, flags);
+ different2 |= insertAttribute(dict, appDic, AIcon,
value, flags);
+ WMReleasePropList(value);
+ }
wfree(icon_file);
}
http://repo.or.cz/w/wmaker-crm.git/commit/e750f9307eef531060aa8c4d5ab8ca4f3311c894
commit e750f9307eef531060aa8c4d5ab8ca4f3311c894
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:47 2014 +0200
WMaker: fix memory leak in the window inspector when saving settings
(Coverity #50174)
As pointed by Coverity, there is one case where the application dictionary
which is created temporarily (when saving the changes in the Window
Inspector) could be left allocated. It is now freed in the common path to
avoid problems.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/winspector.c b/src/winspector.c
index e814fa32..679c56f8 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -598,7 +598,6 @@ static void saveSettings(WMWidget *button, void
*client_data)
WMPutInPLDictionary(dict, key2, appDic);
}
WMReleasePropList(key2);
- WMReleasePropList(appDic);
} else if (wwin->main_window != wwin->client_win) {
WApplication *wapp = wApplicationOf(wwin->main_window);
@@ -617,13 +616,12 @@ static void saveSettings(WMWidget *button, void
*client_data)
WMPutInPLDictionary(dict, key2, appDic);
}
WMReleasePropList(key2);
- WMReleasePropList(appDic);
}
} else {
WMMergePLDictionaries(winDic, appDic, True);
different |= different2;
- WMReleasePropList(appDic);
}
+ WMReleasePropList(appDic);
WMRemoveFromPLDictionary(dict, key);
if (different)
http://repo.or.cz/w/wmaker-crm.git/commit/a75699faefaa9b91ef78804e1b810f618ddf8825
commit a75699faefaa9b91ef78804e1b810f618ddf8825
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:46 2014 +0200
WMaker: fix possible memory leak in the icon chooser dialog (Coverity
#50173)
As reported by Coverity, it was possible to return early from the function
'listCallback' without de-allocating a temporary string. The string is now
requested after this early return.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/dialog.c b/src/dialog.c
index 6b26aef8..90e7192b 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -664,13 +664,13 @@ static void listCallback(void *self, void *data)
if (item == NULL)
return;
path = item->text;
- tmp = wexpandpath(path);
item = WMGetListSelectedItem(panel->iconList);
if (item == NULL)
return;
iconFile = item->text;
+ tmp = wexpandpath(path);
path = wmalloc(strlen(tmp) + strlen(iconFile) + 4);
strcpy(path, tmp);
strcat(path, "/");
http://repo.or.cz/w/wmaker-crm.git/commit/bec027258431c1f6d32dafe9f49f57017ba380ff
commit bec027258431c1f6d32dafe9f49f57017ba380ff
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:45 2014 +0200
WMaker: fix dangerous code in file scanning for wAdvancedInputDialog
(Coverity #50172)
As pointer by Coverity, the function wstrappend may move the string in
memory (because that's what realloc does if it can't expand the allocated
buffer in-place), so it is important to use the returned address and not
assume the old pointer is still valid.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/dialog.c b/src/dialog.c
index 8eb01f1a..6b26aef8 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -275,7 +275,7 @@ ScanFiles(const char *dir, const char *prefix, unsigned
acceptmask, unsigned dec
de->d_name + prefixlen) ==
WANotFound) {
suffix = wstrdup(de->d_name +
prefixlen);
if (sb.st_mode & S_IFDIR)
- wstrappend(suffix,"/");
+ suffix = wstrappend(suffix,
"/");
WMAddToArray(result, suffix);
}
wfree(fullfilename);
http://repo.or.cz/w/wmaker-crm.git/commit/32c8dc04ce40c72b19f11c90fddd2bd0329d9305
commit 32c8dc04ce40c72b19f11c90fddd2bd0329d9305
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:44 2014 +0200
WMaker: fix memory leak in windows saved state handling (Coverity #50171)
As pointed by Coverity, the caller of the function 'getSavedState' assumes
that if the function returns 0 then the wstate is not initialised. This was
not actually true, so this patch changes 'getSavedState' to behave as
expected.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/window.c b/src/window.c
index 9a6adbdd..a33747b8 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2319,6 +2319,11 @@ static int getSavedState(Window window, WSavedState **
state)
(unsigned char **)&data) != Success || !data ||
nitems_ret < 10)
return 0;
+ if (type_ret != w_global.atom.wmaker.state) {
+ XFree(data);
+ return 0;
+ }
+
*state = wmalloc(sizeof(WSavedState));
(*state)->workspace = data[0];
@@ -2334,10 +2339,7 @@ static int getSavedState(Window window, WSavedState **
state)
XFree(data);
- if (*state && type_ret == w_global.atom.wmaker.state)
- return 1;
- else
- return 0;
+ return 1;
}
#ifdef USE_XSHAPE
http://repo.or.cz/w/wmaker-crm.git/commit/4501d4c0786081fa27e4f0130bfed57547e52aa2
commit 4501d4c0786081fa27e4f0130bfed57547e52aa2
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:43 2014 +0200
WMaker: fix memory leak when respawning after crash (Coverity #50165)
As pointed by Coverity, the memory allocated to contain the argument list
for spawning ourself was never released.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/monitor.c b/src/monitor.c
index c023b306..f06ff517 100644
--- a/src/monitor.c
+++ b/src/monitor.c
@@ -125,6 +125,7 @@ int MonitorLoop(int argc, char **argv)
* the crash panel and ask the user what to do */
if (time(NULL) - last_start < 3) {
if (showCrashDialog(WTERMSIG(status)) == 0) {
+ wfree(child_argv);
return 1;
}
}
@@ -133,5 +134,6 @@ int MonitorLoop(int argc, char **argv)
} else
break;
}
+ wfree(child_argv);
return 0;
}
http://repo.or.cz/w/wmaker-crm.git/commit/659519f3065862a348d13f89ebb98db34cb4c056
commit 659519f3065862a348d13f89ebb98db34cb4c056
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:42 2014 +0200
WMaker: fix memory leak in the crash handling dialog (Coverity #50163)
As pointed by Coverity, if the function wShowCrashingDialogPanel is not
able to connect to the default screen, then the memory allocated for the
panel would be leaked.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/dialog.c b/src/dialog.c
index 11027471..8eb01f1a 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -1569,8 +1569,6 @@ int wShowCrashingDialogPanel(int whatSig)
int action;
char buf[256];
- panel = wmalloc(sizeof(CrashPanel));
-
screen_no = DefaultScreen(dpy);
scr_width = WidthOfScreen(ScreenOfDisplay(dpy, screen_no));
scr_height = HeightOfScreen(ScreenOfDisplay(dpy, screen_no));
@@ -1581,6 +1579,8 @@ int wShowCrashingDialogPanel(int whatSig)
return WMAbort;
}
+ panel = wmalloc(sizeof(CrashPanel));
+
panel->retKey = XKeysymToKeycode(dpy, XK_Return);
panel->win = WMCreateWindow(scr, "crashingDialog");
http://repo.or.cz/w/wmaker-crm.git/commit/c2a357fe1bd95c59c839e874decd83ca4607fc8b
commit c2a357fe1bd95c59c839e874decd83ca4607fc8b
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:41 2014 +0200
WMaker: fix memory leak in app icon changing (Coverity #50139)
As pointed by Coverity, there are some cases where the name of the file
returned by wIconChooserDialog could be left unfreed.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/appicon.c b/src/appicon.c
index 4d4d81eb..43a0f32a 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -534,13 +534,16 @@ static void setIconCallback(WMenu *menu, WMenuEntry
*entry)
result = wIconChooserDialog(scr, &file, icon->wm_instance,
icon->wm_class);
- if (result && !icon->destroyed) {
- if (!wIconChangeImageFile(icon->icon, file)) {
- wMessageDialog(scr, _("Error"),
- _("Could not open specified icon file"),
_("OK"), NULL, NULL);
- } else {
- wDefaultChangeIcon(icon->wm_instance, icon->wm_class,
file);
- wAppIconPaint(icon);
+ if (result) {
+ if (!icon->destroyed) {
+ if (!wIconChangeImageFile(icon->icon, file)) {
+ wMessageDialog(scr, _("Error"),
+ _("Could not open specified icon
file"),
+ _("OK"), NULL, NULL);
+ } else {
+ wDefaultChangeIcon(icon->wm_instance,
icon->wm_class, file);
+ wAppIconPaint(icon);
+ }
}
if (file)
wfree(file);
http://repo.or.cz/w/wmaker-crm.git/commit/3a68e974b65cf8b11d6352499e322c7bd7c7a25c
commit 3a68e974b65cf8b11d6352499e322c7bd7c7a25c
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:40 2014 +0200
WMaker: removed unnecessary case handling in appicon setting
The function wIconChooserDialog already makes sure that it returns
NULL if its result would have been an empty string, so it is not
necessary to re-check this in setIconCallback, this leads to
more complicated code and can't be optimised by the compiler.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/appicon.c b/src/appicon.c
index bbf1455f..4d4d81eb 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -535,10 +535,6 @@ static void setIconCallback(WMenu *menu, WMenuEntry *entry)
result = wIconChooserDialog(scr, &file, icon->wm_instance,
icon->wm_class);
if (result && !icon->destroyed) {
- if (file && *file == 0) {
- wfree(file);
- file = NULL;
- }
if (!wIconChangeImageFile(icon->icon, file)) {
wMessageDialog(scr, _("Error"),
_("Could not open specified icon file"),
_("OK"), NULL, NULL);
http://repo.or.cz/w/wmaker-crm.git/commit/fab73f47c71d851de7ff71533b17540dde5659b2
commit fab73f47c71d851de7ff71533b17540dde5659b2
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:39 2014 +0200
WMaker: fix memory leak in screen initialisation (Coverity #50134)
As pointed by Coverity, if the function wScreenInit fails to properly
attach to the screen then the storage structure and content were not
released before returning.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/screen.c b/src/screen.c
index afc9d17d..bb9d9b3f 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -593,6 +593,12 @@ WScreen *wScreenInit(int screen_number)
if (!scr->wmscreen) {
wfatal(_("could not initialize WINGs widget set"));
+ RDestroyContext(scr->rcontext);
+ WMFreeArray(scr->fakeGroupLeaders);
+ wfree(scr->totalUsableArea);
+ wfree(scr->usableArea);
+ WMFreeBag(scr->stacking_list);
+ wfree(scr);
return NULL;
}
http://repo.or.cz/w/wmaker-crm.git/commit/99400735303826db7fa0ed1f836abc157cb965e6
commit 99400735303826db7fa0ed1f836abc157cb965e6
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:38 2014 +0200
WMaker: fix memory leak in the switchpanel backgroung image (Coverity
#50131)
As pointed by Coverity, if the target width or height for the center ended
being <= 0 then the image created to contain the generated assemblage would
be leaked.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/switchpanel.c b/src/switchpanel.c
index 16083658..e7bee409 100644
--- a/src/switchpanel.c
+++ b/src/switchpanel.c
@@ -239,19 +239,10 @@ static void scrollIcons(WSwitchPanel *panel, int delta)
*/
static RImage *assemblePuzzleImage(RImage **images, int width, int height)
{
- RImage *img = RCreateImage(width, height, 1);
+ RImage *img;
RImage *tmp;
int tw, th;
RColor color;
- if (!img)
- return NULL;
-
- color.red = 0;
- color.green = 0;
- color.blue = 0;
- color.alpha = 255;
-
- RFillImage(img, &color);
tw = width - images[0]->width - images[2]->width;
th = height - images[0]->height - images[6]->height;
@@ -259,6 +250,16 @@ static RImage *assemblePuzzleImage(RImage **images, int
width, int height)
if (tw <= 0 || th <= 0)
return NULL;
+ img = RCreateImage(width, height, 1);
+ if (!img)
+ return NULL;
+
+ color.red = 0;
+ color.green = 0;
+ color.blue = 0;
+ color.alpha = 255;
+ RFillImage(img, &color);
+
/* top */
if (tw > 0) {
tmp = RSmoothScaleImage(images[1], tw, images[1]->height);
http://repo.or.cz/w/wmaker-crm.git/commit/7d48855077703d3537aee39f16634cc06f2ec272
commit 7d48855077703d3537aee39f16634cc06f2ec272
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:37 2014 +0200
WMaker: fix memory leak in workspace switching (Coverity #50126)
As pointed by Coverity, if there's no window to unmap in a workspace, then
the array used to build the list of the windows to be unmapped for
workspace change would not be freed.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/workspace.c b/src/workspace.c
index b0c436d0..d58f9046 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -472,8 +472,6 @@ void wWorkspaceRelativeChange(WScreen * scr, int amount)
void wWorkspaceForceChange(WScreen * scr, int workspace)
{
WWindow *tmp, *foc = NULL, *foc2 = NULL;
- WWindow **toUnmap;
- int toUnmapSize, toUnmapCount;
if (workspace >= MAX_WORKSPACES || workspace < 0)
return;
@@ -492,16 +490,19 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
wWorkspaceMenuUpdate(w_global.clip.ws_menu);
- toUnmapSize = 16;
- toUnmapCount = 0;
- toUnmap = wmalloc(toUnmapSize * sizeof(WWindow *));
-
if ((tmp = scr->focused_window) != NULL) {
+ WWindow **toUnmap;
+ int toUnmapSize, toUnmapCount;
+
if ((IS_OMNIPRESENT(tmp) && (tmp->flags.mapped ||
tmp->flags.shaded) &&
!WFLAGP(tmp, no_focusable)) ||
tmp->flags.changing_workspace) {
foc = tmp;
}
+ toUnmapSize = 16;
+ toUnmapCount = 0;
+ toUnmap = wmalloc(toUnmapSize * sizeof(WWindow *));
+
/* foc2 = tmp; will fix annoyance with gnome panel
* but will create annoyance for every other application
*/
http://repo.or.cz/w/wmaker-crm.git/commit/9f2f94a17420b97d81d45bbab9764fb2716a3e12
commit 9f2f94a17420b97d81d45bbab9764fb2716a3e12
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:36 2014 +0200
WMaker: fix memory leak in root menu parser (Coverity #50123 and #50124)
As pointed by Coverity, if an invalid OPEN_MENU is used then the memory
allocated when parsing the line containing it would be leaked.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/rootmenu.c b/src/rootmenu.c
index 8f0723cc..a922f5ea 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -627,6 +627,11 @@ static void constructMenu(WMenu * menu, WMenuEntry * entry)
separateCommand((char *)entry->clientdata, &path, &cmd);
if (path == NULL || *path == NULL || **path == 0) {
wwarning(_("invalid OPEN_MENU specification: %s"), (char
*)entry->clientdata);
+ if (path) {
+ for (i = 0; path[i] != NULL; i++)
+ wfree(path[i]);
+ wfree(path);
+ }
if (cmd)
wfree(cmd);
return;
@@ -747,6 +752,11 @@ static void constructPLMenuFromPipe(WMenu * menu,
WMenuEntry * entry)
if (path == NULL || *path == NULL || **path == 0) {
wwarning(_("invalid OPEN_PLMENU specification: %s"),
(char *)entry->clientdata);
+ if (path) {
+ for (i = 0; path[i] != NULL; i++)
+ wfree(path[i]);
+ wfree(path);
+ }
if (cmd)
wfree(cmd);
return;
http://repo.or.cz/w/wmaker-crm.git/commit/741243a792a379872543f1ad7989dad2c6fbd3fc
commit 741243a792a379872543f1ad7989dad2c6fbd3fc
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:35 2014 +0200
WMaker: fix memory leak in the root menu parser (Coverity #50122)
As pointed by Coverity, if the word "WITH" was used in the content of the
root menu definition then its string would not be freed.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/rootmenu.c b/src/rootmenu.c
index ca7750c9..8f0723cc 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -571,6 +571,7 @@ static void separateCommand(char *line, char ***file, char
**command)
*command = wstrdup(tmp);
else
wwarning(_("%s: missing command"),
line);
+ wfree(token);
break;
}
WMAddToArray(array, token);
http://repo.or.cz/w/wmaker-crm.git/commit/bee02df72f1ff02fa11533f666d955511d9c3fbd
commit bee02df72f1ff02fa11533f666d955511d9c3fbd
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:34 2014 +0200
WMaker: fix memory leak in wDockTrackWindowLaunch (Coverity #50120 and
#50121)
As pointed by Coverity, the function 'ProgGetWMClass' always allocates the
strings returned in wm_class and wm_instance, so they always must be freed.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/dock.c b/src/dock.c
index 6c76d1c1..3fd3dbe1 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -3204,8 +3204,11 @@ void wDockTrackWindowLaunch(WDock *dock, Window window)
Bool found = False;
char *command = NULL;
- if (!PropGetWMClass(window, &wm_class, &wm_instance) || (!wm_class &&
!wm_instance))
+ if (!PropGetWMClass(window, &wm_class, &wm_instance)) {
+ free(wm_class);
+ free(wm_instance);
return;
+ }
command = GetCommandForWindow(window);
retry:
http://repo.or.cz/w/wmaker-crm.git/commit/d292c6208038d08f85f81f15ddbed12d42d57602
commit d292c6208038d08f85f81f15ddbed12d42d57602
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:33 2014 +0200
WMaker: fix memory leak in the windows icon chooser (Coverity #50117.2)
As pointed by Coverity, a string could be left unfreed in the case where
the window's attribute dialog is closed before an icon would be actually
chosen from the Icon Chooser Dialog.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/winspector.c b/src/winspector.c
index b265f48e..e814fa32 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -971,12 +971,13 @@ static void chooseIconCallback(WMWidget *self, void
*clientData)
if (result) {
WMSetTextFieldText(panel->fileText, file);
showIconFor(WMWidgetScreen(self), panel, NULL, NULL,
USE_TEXT_FIELD);
- wfree(file);
}
WMSetButtonEnabled(panel->browseIconBtn, True);
} else {
freeInspector(panel);
}
+ if (result)
+ wfree(file);
}
static void textEditedObserver(void *observerData, WMNotification
*notification)
http://repo.or.cz/w/wmaker-crm.git/commit/dc4df6455a2868577c04279af04bf4741e9b0d02
commit dc4df6455a2868577c04279af04bf4741e9b0d02
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:32 2014 +0200
WMaker: fix memory leak in the docked apps icon chooser (Coverity #50117.1)
As pointed by Coverity, a string could be left unfreed in the case where
the docked application's settings dialog is closed before an icon would be
actually chosen from the Icon Chooser Dialog.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/dockedapp.c b/src/dockedapp.c
index 63a4864d..a7bca3bd 100644
--- a/src/dockedapp.c
+++ b/src/dockedapp.c
@@ -136,7 +136,6 @@ static void chooseIconCallback(WMWidget * self, void
*clientData)
if (!panel->destroyed) {
if (result) {
WMSetTextFieldText(panel->iconField, file);
- wfree(file);
updateSettingsPanelIcon(panel);
}
@@ -146,6 +145,8 @@ static void chooseIconCallback(WMWidget * self, void
*clientData)
* the icon chooser */
DestroyDockAppSettingsPanel(panel);
}
+ if (result)
+ wfree(file);
}
static void panelBtnCallback(WMWidget * self, void *data)
http://repo.or.cz/w/wmaker-crm.git/commit/4894e3fe4d03b92de1dd1e4ba2b037068960c0bf
commit 4894e3fe4d03b92de1dd1e4ba2b037068960c0bf
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:31 2014 +0200
WMaker: fix memory leak in window inspector (Coverity #50116)
As pointed by Coverity, in this specific case the string previously stored
in 'file' was lost when replaced with the string from 'db_icon'. The logic
have been simplified to avoid the case.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/winspector.c b/src/winspector.c
index 1e185f52..b265f48e 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -307,7 +307,7 @@ static void changePage(WMWidget *bPtr, void *client_data)
static int showIconFor(WMScreen *scrPtr, InspectorPanel *panel, const char
*wm_instance, const char *wm_class, int flags)
{
WMPixmap *pixmap = (WMPixmap *) NULL;
- char *file = NULL, *path = NULL, *db_icon = NULL;
+ char *file = NULL, *path = NULL;
if ((flags & USE_TEXT_FIELD) != 0) {
file = WMGetTextFieldText(panel->fileText);
@@ -315,16 +315,15 @@ static int showIconFor(WMScreen *scrPtr, InspectorPanel
*panel, const char *wm_i
wfree(file);
file = NULL;
}
- } else {
+ } else if (flags & REVERT_TO_DEFAULT) {
+ const char *db_icon;
+
/* Get the application icon, default NOT included */
db_icon = wDefaultGetIconFile(wm_instance, wm_class, False);
- if (db_icon != NULL)
- file = wstrdup(db_icon);
- }
- if (db_icon != NULL && (flags & REVERT_TO_DEFAULT) != 0) {
- if (file)
+ if (db_icon != NULL) {
file = wstrdup(db_icon);
- flags |= UPDATE_TEXT_FIELD;
+ flags |= UPDATE_TEXT_FIELD;
+ }
}
if ((flags & UPDATE_TEXT_FIELD) != 0)
http://repo.or.cz/w/wmaker-crm.git/commit/43972d307ad232d926c250becc3ad80e866f1494
commit 43972d307ad232d926c250becc3ad80e866f1494
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:30 2014 +0200
WMaker: fix memory leak in windows menu (Coverity #50109)
As pointed by Coverity, there was a memory leak when updating the shortcuts
in the menu for windows which occured when a shortcut was associated with
the window and this shortcut did not change.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/winmenu.c b/src/winmenu.c
index d8b3f4f3..5cf568b1 100644
--- a/src/winmenu.c
+++ b/src/winmenu.c
@@ -361,7 +361,6 @@ static void updateMakeShortcutMenu(WMenu *menu, WWindow
*wwin)
buffer = wmalloc(buflen);
for (i = WO_ENTRIES; i < smenu->entry_no; i++) {
- char *tmp;
int shortcutNo = i - WO_ENTRIES;
WMenuEntry *entry = smenu->entries[i];
WMArray *shortSelWindows =
w_global.shortcut.windows[shortcutNo];
@@ -387,12 +386,28 @@ static void updateMakeShortcutMenu(WMenu *menu, WWindow
*wwin)
kcode = wKeyBindings[WKBD_WINDOW1 + shortcutNo].keycode;
if (kcode) {
- if ((tmp = GetShortcutKey(wKeyBindings[WKBD_WINDOW1 +
shortcutNo]))
- && (!entry->rtext || strcmp(tmp, entry->rtext) !=
0)) {
- if (entry->rtext)
+ char *tmp;
+
+ tmp = GetShortcutKey(wKeyBindings[WKBD_WINDOW1 +
shortcutNo]);
+ if (tmp == NULL) {
+ if (entry->rtext != NULL) {
+ /* There was a shortcut, but there is
no more */
wfree(entry->rtext);
+ entry->rtext = NULL;
+ smenu->flags.realized = 0;
+ }
+ } else if (entry->rtext == NULL) {
+ /* There was no shortcut, but there is one now
*/
entry->rtext = tmp;
smenu->flags.realized = 0;
+ } else if (strcmp(tmp, entry->rtext) != 0) {
+ /* There was a shortcut, but it has changed */
+ wfree(entry->rtext);
+ entry->rtext = tmp;
+ smenu->flags.realized = 0;
+ } else {
+ /* There was a shortcut but it did not change */
+ wfree(tmp);
}
wMenuSetEnabled(smenu, i, True);
} else {
http://repo.or.cz/w/wmaker-crm.git/commit/7f840db1aa0882e81225b66ad18820a048f3d069
commit 7f840db1aa0882e81225b66ad18820a048f3d069
Author: Christophe CURIS <[email protected]>
Date: Tue May 20 21:46:29 2014 +0200
WMaker: remove unnecessary check in Balloon show function (Coverity #50065)
As pointed by Coverity, there is a check to make sure a pointer is not NULL
but it is still dereferenced later in the function. As the code is done so
that this pointer cannot be NULL then it is not necessary to check that.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/src/balloon.c b/src/balloon.c
index 6c056e44..b9c77bb2 100644
--- a/src/balloon.c
+++ b/src/balloon.c
@@ -382,10 +382,8 @@ static void showBalloon(WScreen * scr)
Window foow;
unsigned foo, w;
- if (scr->balloon) {
- scr->balloon->timer = NULL;
- scr->balloon->ignoreTimer = 1;
- }
+ scr->balloon->timer = NULL;
+ scr->balloon->ignoreTimer = 1;
if (!XGetGeometry(dpy, scr->balloon->objectWindow, &foow, &x, &y, &w,
&foo, &foo, &foo)) {
scr->balloon->prevType = 0;
-----------------------------------------------------------------------
Summary of changes:
src/appicon.c | 21 ++++++++++-----------
src/balloon.c | 6 ++----
src/defaults.c | 8 +++-----
src/dialog.c | 8 ++++----
src/dock.c | 9 +++++++--
src/dockedapp.c | 3 ++-
src/monitor.c | 2 ++
src/osdep_linux.c | 8 ++------
src/rootmenu.c | 11 +++++++++++
src/screen.c | 6 ++++++
src/switchpanel.c | 21 +++++++++++----------
src/window.c | 10 ++++++----
src/winmenu.c | 23 +++++++++++++++++++----
src/winspector.c | 34 +++++++++++++++++-----------------
src/workspace.c | 13 +++++++------
15 files changed, 109 insertions(+), 74 deletions(-)
repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
--
To unsubscribe, send mail to [email protected].