summaryrefslogtreecommitdiff
path: root/app/cwm
diff options
context:
space:
mode:
authorMichael Knudsen <mk@cvs.openbsd.org>2008-06-16 19:09:49 +0000
committerMichael Knudsen <mk@cvs.openbsd.org>2008-06-16 19:09:49 +0000
commit4ef53197ff043a3d30b610d03e29baae91a03ed2 (patch)
tree74f32abf07e04279f66b668d8391b12a79424616 /app/cwm
parent99aee37327a580a9aa1e05d2cae58a83a0461813 (diff)
Make this not crash when compiled with -g.
Found by myself, analysis by kurt@, fix by me with input from otto. ``Just get some fix in...'' deraadt
Diffstat (limited to 'app/cwm')
-rw-r--r--app/cwm/conf.c4
-rw-r--r--app/cwm/parse.y9
2 files changed, 5 insertions, 8 deletions
diff --git a/app/cwm/conf.c b/app/cwm/conf.c
index 69b422686..c30b3f861 100644
--- a/app/cwm/conf.c
+++ b/app/cwm/conf.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: conf.c,v 1.40 2008/06/15 02:47:46 oga Exp $
+ * $Id: conf.c,v 1.41 2008/06/16 19:09:48 mk Exp $
*/
#include "headers.h"
@@ -171,7 +171,7 @@ conf_init(struct conf *c)
strlcpy(c->termpath, "xterm", sizeof(c->termpath));
strlcpy(c->lockpath, "xlock", sizeof(c->lockpath));
- c->DefaultFontName = DEFAULTFONTNAME;
+ c->DefaultFontName = xstrdup(DEFAULTFONTNAME);
}
void
diff --git a/app/cwm/parse.y b/app/cwm/parse.y
index c67ddbe79..e80c1cbba 100644
--- a/app/cwm/parse.y
+++ b/app/cwm/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.12 2008/06/15 02:47:46 oga Exp $ */
+/* $OpenBSD: parse.y,v 1.13 2008/06/16 19:09:48 mk Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -100,11 +100,8 @@ yesno : YES { $$ = 1; }
;
main : FONTNAME STRING {
- if (conf->DefaultFontName != NULL &&
- conf->DefaultFontName != DEFAULTFONTNAME)
- free(conf->DefaultFontName);
- conf->DefaultFontName = xstrdup($2);
- free($2);
+ free(conf->DefaultFontName);
+ conf->DefaultFontName = $2;
}
| STICKY yesno {
if ($2 == 0)