summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/menus.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index fbbfd4e..75b5414 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-02 Alan Coopersmith <alan.coopersmith@sun.com>
+
+ * src/menus.c (ExecuteFunction):
+ Coverity #1508: Variable "action" not freed or pointed-to
+
2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
diff --git a/src/menus.c b/src/menus.c
index 0b4b707..d91dd24 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -1244,7 +1244,7 @@ resizeFromCenter(Window w, TwmWindow *tmp_win)
-/** \fn ExecureFunction
+/** \fn ExecuteFunction
* execute a twm root function.
*
* \param func the function to execute
@@ -2155,8 +2155,8 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win,
break;
case F_FILE:
- action = ExpandFilename(action);
- fd = open(action, O_RDONLY);
+ ptr = ExpandFilename(action);
+ fd = open(ptr, O_RDONLY);
if (fd >= 0)
{
count = read(fd, buff, MAX_FILE_SIZE - 1);
@@ -2168,8 +2168,9 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win,
else
{
fprintf (stderr, "%s: unable to open file \"%s\"\n",
- ProgramName, action);
+ ProgramName, ptr);
}
+ if (ptr != action) free(ptr);
break;
case F_REFRESH: