summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-03 07:06:42 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-03 07:06:42 +0000
commit4bc5a25c21006e547ff7fce7fff7544acbb22174 (patch)
tree1131660dedc1706245380ff2be67b73529050398
parent9680fbed52e3af20d226040958f91502b6027d2d (diff)
Coverity #369: If malloc of entry->wm_command fails, error cleanup was
still trying to read pointers from it to free.
-rw-r--r--ChangeLog6
-rw-r--r--src/session.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 75b5414..5475530 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-03 Alan Coopersmith <alan.coopersmith@sun.com>
+
+ * src/session.c (ReadWinConfigEntry):
+ Coverity #369: If malloc of entry->wm_command fails, error cleanup
+ was still trying to read pointers from it to free.
+
2006-06-02 Alan Coopersmith <alan.coopersmith@sun.com>
* src/menus.c (ExecuteFunction):
diff --git a/src/session.c b/src/session.c
index 01fa593..7c4ce99 100644
--- a/src/session.c
+++ b/src/session.c
@@ -1,5 +1,5 @@
/* $Xorg: session.c,v 1.5 2001/02/09 02:05:37 xorgcvs Exp $ */
-/* $XdotOrg: $ */
+/* $XdotOrg: app/twm/src/session.c,v 1.3 2005/07/16 22:07:13 alanc Exp $ */
/******************************************************************************
Copyright 1994, 1998 The Open Group
@@ -529,7 +529,7 @@ give_up:
free (entry->class.res_class);
if (entry->wm_name)
free (entry->wm_name);
- if (entry->wm_command_count)
+ if (entry->wm_command_count && entry->wm_command)
{
for (i = 0; i < entry->wm_command_count; i++)
if (entry->wm_command[i])