summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-03 06:54:20 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-03 06:54:20 +0000
commit9680fbed52e3af20d226040958f91502b6027d2d (patch)
tree3a3eb85446362931dc5908ce9e106004093fb259
parentab7a497d995347e340c28c4eb0d1f0f9ee298e41 (diff)
Coverity #1508: Variable "action" not freed or pointed-to
-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: