diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2006-06-03 06:54:20 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2006-06-03 06:54:20 +0000 |
commit | 9680fbed52e3af20d226040958f91502b6027d2d (patch) | |
tree | 3a3eb85446362931dc5908ce9e106004093fb259 /src/menus.c | |
parent | ab7a497d995347e340c28c4eb0d1f0f9ee298e41 (diff) |
Coverity #1508: Variable "action" not freed or pointed-to
Diffstat (limited to 'src/menus.c')
-rw-r--r-- | src/menus.c | 9 |
1 files changed, 5 insertions, 4 deletions
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: |